From 7d1a1c6fe499667e46a49b2c2c3fb53f53c83602 Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Fri, 27 Mar 2026 23:33:57 +0900 Subject: [PATCH 1/2] docs: add projectId to clasp configuration examples All setup docs now include the optional projectId field in .clasp.json examples and CI/CD variable tables. This makes the GCP project association declarative per script, supporting organizations that distribute scripts across multiple GCP projects. --- docs/setup-github.ja.md | 15 +++++++++------ docs/setup-github.md | 15 +++++++++------ docs/setup-gitlab.ja.md | 15 +++++++++------ docs/setup-gitlab.md | 15 +++++++++------ 4 files changed, 36 insertions(+), 24 deletions(-) diff --git a/docs/setup-github.ja.md b/docs/setup-github.ja.md index da0a7d0..6446676 100644 --- a/docs/setup-github.ja.md +++ b/docs/setup-github.ja.md @@ -33,18 +33,21 @@ pnpm install ```json { "scriptId": "YOUR_SCRIPT_ID", + "projectId": "YOUR_GCP_PROJECT_ID", "rootDir": "dist" } ``` +> **`projectId`** は Apps Script に紐づく GCP プロジェクト番号(文字列 ID ではなく数値)です。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 + ### 3. GitHub Environments の設定 -| Environment | Secret / Variable | 値 | -| ------------- | ------------------------- | ----------------------------------------- | -| `development` | Secret: `CLASP_JSON` | `{"scriptId":"DEV_ID","rootDir":"dist"}` | -| `development` | Variable: `DEPLOYMENT_ID` | dev のデプロイメント ID | -| `production` | Secret: `CLASP_JSON` | `{"scriptId":"PROD_ID","rootDir":"dist"}` | -| `production` | Variable: `DEPLOYMENT_ID` | prod のデプロイメント ID | +| Environment | Secret / Variable | 値 | +| ------------- | ------------------------- | ------------------------------------------------------------------ | +| `development` | Secret: `CLASP_JSON` | `{"scriptId":"DEV_ID","projectId":"GCP_NUM","rootDir":"dist"}` | +| `development` | Variable: `DEPLOYMENT_ID` | dev のデプロイメント ID | +| `production` | Secret: `CLASP_JSON` | `{"scriptId":"PROD_ID","projectId":"GCP_NUM","rootDir":"dist"}` | +| `production` | Variable: `DEPLOYMENT_ID` | prod のデプロイメント ID | ### 4. 確認とデプロイ diff --git a/docs/setup-github.md b/docs/setup-github.md index 3848a34..a77af49 100644 --- a/docs/setup-github.md +++ b/docs/setup-github.md @@ -33,18 +33,21 @@ Create `.clasp-dev.json` and `.clasp-prod.json` (gitignored): ```json { "scriptId": "YOUR_SCRIPT_ID", + "projectId": "YOUR_GCP_PROJECT_ID", "rootDir": "dist" } ``` +> **`projectId`** is the GCP project number (not the string ID) associated with your Apps Script. Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. + ### 3. Configure GitHub environments -| Environment | Secret / Variable | Value | -| ------------- | ------------------------- | ----------------------------------------- | -| `development` | Secret: `CLASP_JSON` | `{"scriptId":"DEV_ID","rootDir":"dist"}` | -| `development` | Variable: `DEPLOYMENT_ID` | Your dev deployment ID | -| `production` | Secret: `CLASP_JSON` | `{"scriptId":"PROD_ID","rootDir":"dist"}` | -| `production` | Variable: `DEPLOYMENT_ID` | Your prod deployment ID | +| Environment | Secret / Variable | Value | +| ------------- | ------------------------- | ------------------------------------------------------------------ | +| `development` | Secret: `CLASP_JSON` | `{"scriptId":"DEV_ID","projectId":"GCP_NUM","rootDir":"dist"}` | +| `development` | Variable: `DEPLOYMENT_ID` | Your dev deployment ID | +| `production` | Secret: `CLASP_JSON` | `{"scriptId":"PROD_ID","projectId":"GCP_NUM","rootDir":"dist"}` | +| `production` | Variable: `DEPLOYMENT_ID` | Your prod deployment ID | ### 4. Verify and deploy diff --git a/docs/setup-gitlab.ja.md b/docs/setup-gitlab.ja.md index f88b7c8..5dd6a3d 100644 --- a/docs/setup-gitlab.ja.md +++ b/docs/setup-gitlab.ja.md @@ -83,20 +83,23 @@ pnpm install ```json { "scriptId": "YOUR_SCRIPT_ID", + "projectId": "YOUR_GCP_PROJECT_ID", "rootDir": "dist" } ``` +> **`projectId`** は Apps Script に紐づく GCP プロジェクト番号(文字列 ID ではなく数値)です。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 + ### 3. CI/CD Variables の設定 Settings → CI/CD → Variables で以下を追加: -| 変数 | Environment scope | 値 | オプション | -| --------------- | ----------------- | ----------------------------------------- | ---------- | -| `CLASP_JSON` | `development` | `{"scriptId":"DEV_ID","rootDir":"dist"}` | Masked | -| `CLASP_JSON` | `production` | `{"scriptId":"PROD_ID","rootDir":"dist"}` | Masked | -| `DEPLOYMENT_ID` | `development` | dev のデプロイメント ID | | -| `DEPLOYMENT_ID` | `production` | prod のデプロイメント ID | | +| 変数 | Environment scope | 値 | オプション | +| --------------- | ----------------- | ------------------------------------------------------------------ | ---------- | +| `CLASP_JSON` | `development` | `{"scriptId":"DEV_ID","projectId":"GCP_NUM","rootDir":"dist"}` | Masked | +| `CLASP_JSON` | `production` | `{"scriptId":"PROD_ID","projectId":"GCP_NUM","rootDir":"dist"}` | Masked | +| `DEPLOYMENT_ID` | `development` | dev のデプロイメント ID | | +| `DEPLOYMENT_ID` | `production` | prod のデプロイメント ID | | ### 4. Template Sync の設定 diff --git a/docs/setup-gitlab.md b/docs/setup-gitlab.md index ee735c0..3cfbdff 100644 --- a/docs/setup-gitlab.md +++ b/docs/setup-gitlab.md @@ -83,20 +83,23 @@ Create `.clasp-dev.json` and `.clasp-prod.json` (gitignored): ```json { "scriptId": "YOUR_SCRIPT_ID", + "projectId": "YOUR_GCP_PROJECT_ID", "rootDir": "dist" } ``` +> **`projectId`** is the GCP project number (not the string ID) associated with your Apps Script. Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. + ### 3. Configure CI/CD Variables Go to Settings → CI/CD → Variables and add: -| Variable | Environment scope | Value | Options | -| --------------- | ----------------- | ----------------------------------------- | ------- | -| `CLASP_JSON` | `development` | `{"scriptId":"DEV_ID","rootDir":"dist"}` | Masked | -| `CLASP_JSON` | `production` | `{"scriptId":"PROD_ID","rootDir":"dist"}` | Masked | -| `DEPLOYMENT_ID` | `development` | Your dev deployment ID | | -| `DEPLOYMENT_ID` | `production` | Your prod deployment ID | | +| Variable | Environment scope | Value | Options | +| --------------- | ----------------- | ------------------------------------------------------------------ | ------- | +| `CLASP_JSON` | `development` | `{"scriptId":"DEV_ID","projectId":"GCP_NUM","rootDir":"dist"}` | Masked | +| `CLASP_JSON` | `production` | `{"scriptId":"PROD_ID","projectId":"GCP_NUM","rootDir":"dist"}` | Masked | +| `DEPLOYMENT_ID` | `development` | Your dev deployment ID | | +| `DEPLOYMENT_ID` | `production` | Your prod deployment ID | | ### 4. Set up Template Sync From 2e805928a0811eeefa8ef57477132993613d1d38 Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Fri, 27 Mar 2026 23:35:22 +0900 Subject: [PATCH 2/2] fix: clarify projectId is a numeric string with examples --- docs/setup-github.ja.md | 2 +- docs/setup-github.md | 2 +- docs/setup-gitlab.ja.md | 2 +- docs/setup-gitlab.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/setup-github.ja.md b/docs/setup-github.ja.md index 6446676..ca252a5 100644 --- a/docs/setup-github.ja.md +++ b/docs/setup-github.ja.md @@ -38,7 +38,7 @@ pnpm install } ``` -> **`projectId`** は Apps Script に紐づく GCP プロジェクト番号(文字列 ID ではなく数値)です。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 +> **`projectId`** は Apps Script に紐づく GCP プロジェクト**番号**です(`"123456789"` のような数字列。`my-project-abc` のようなプロジェクト ID ではない)。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 ### 3. GitHub Environments の設定 diff --git a/docs/setup-github.md b/docs/setup-github.md index a77af49..5128765 100644 --- a/docs/setup-github.md +++ b/docs/setup-github.md @@ -38,7 +38,7 @@ Create `.clasp-dev.json` and `.clasp-prod.json` (gitignored): } ``` -> **`projectId`** is the GCP project number (not the string ID) associated with your Apps Script. Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. +> **`projectId`** is the GCP project **number** associated with your Apps Script (a numeric string like `"123456789"`, not the alphanumeric project ID like `my-project-abc`). Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. ### 3. Configure GitHub environments diff --git a/docs/setup-gitlab.ja.md b/docs/setup-gitlab.ja.md index 5dd6a3d..a87b029 100644 --- a/docs/setup-gitlab.ja.md +++ b/docs/setup-gitlab.ja.md @@ -88,7 +88,7 @@ pnpm install } ``` -> **`projectId`** は Apps Script に紐づく GCP プロジェクト番号(文字列 ID ではなく数値)です。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 +> **`projectId`** は Apps Script に紐づく GCP プロジェクト**番号**です(`"123456789"` のような数字列。`my-project-abc` のようなプロジェクト ID ではない)。Apps Script エディタ → プロジェクトの設定 → Google Cloud Platform(GCP)プロジェクトで確認できます。記載することで GCP プロジェクトの紐づけが宣言的・再現可能になります。省略時は clasp がスクリプトの既存 GCP プロジェクトを使用します。 ### 3. CI/CD Variables の設定 diff --git a/docs/setup-gitlab.md b/docs/setup-gitlab.md index 3cfbdff..00ec1b3 100644 --- a/docs/setup-gitlab.md +++ b/docs/setup-gitlab.md @@ -88,7 +88,7 @@ Create `.clasp-dev.json` and `.clasp-prod.json` (gitignored): } ``` -> **`projectId`** is the GCP project number (not the string ID) associated with your Apps Script. Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. +> **`projectId`** is the GCP project **number** associated with your Apps Script (a numeric string like `"123456789"`, not the alphanumeric project ID like `my-project-abc`). Find it in Apps Script editor → Project Settings → Google Cloud Platform (GCP) Project. Including it makes the GCP project association declarative and reproducible. If omitted, clasp uses the script's existing GCP project. ### 3. Configure CI/CD Variables