File tree Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -51,28 +51,33 @@ cat ~/.clasprc.json
51512 . 「Settings」→「Secrets and variables」→「Actions」
52523 . 「New repository secret」をクリック
5353
54- #### サービスアカウント方式の場合
55- - Name: ` GCP_SA_KEY `
56- - Secret: ダウンロードしたJSONファイルの内容全体
54+ #### 必要なSecrets(OAuth方式・推奨)
5755
58- #### OAuth方式の場合(簡易版・推奨)
56+ ** 1. CLASPRC_JSON **
5957- Name: ` CLASPRC_JSON `
6058- Secret: ` ~/.clasprc.json ` の内容全体
6159
62- ### 5. .clasp.jsonの確認
60+ ``` bash
61+ cat ~ /.clasprc.json
62+ ```
6363
64- ` .clasp.json ` がリポジトリにコミットされていることを確認:
64+ ** 2. SCRIPT_ID**
65+ - Name: ` SCRIPT_ID `
66+ - Secret: GASプロジェクトのスクリプトID
6567
66- ``` json
67- {
68- "scriptId" : " your-script-id-here" ,
69- "rootDir" : " ./dist"
70- }
71- ```
68+ スクリプトIDの取得方法:
69+ 1 . 対象のスプレッドシートを開く
70+ 2 . 「拡張機能」→「Apps Script」
71+ 3 . プロジェクトの設定(⚙️アイコン)
72+ 4 . 「スクリプトID」をコピー
7273
73- ** 注意:** ` scriptId ` は公開しても問題ありませんが、気になる場合はSecrets化も可能です。
74+ または` .clasp.json ` から:
75+ ``` bash
76+ cat .clasp.json
77+ # {"scriptId":"ここの値","rootDir":"./dist"}
78+ ```
7479
75- ### 6 . デプロイのテスト
80+ ### 5 . デプロイのテスト
7681
77821 . 新しいブランチを作成
78832 . コードを変更してコミット
Original file line number Diff line number Diff line change @@ -30,14 +30,18 @@ jobs:
3030 - name : Setup clasp credentials
3131 env :
3232 CLASPRC_JSON : ${{ secrets.CLASPRC_JSON }}
33+ SCRIPT_ID : ${{ secrets.SCRIPT_ID }}
3334 run : |
3435 echo "$CLASPRC_JSON" > ~/.clasprc.json
36+ echo "{\"scriptId\":\"$SCRIPT_ID\",\"rootDir\":\"./dist\"}" > .clasp.json
3537
3638 - name : Deploy to GAS
3739 run : npm run push
3840
3941 - name : Notify deployment success
4042 if : success()
43+ env :
44+ SCRIPT_ID : ${{ secrets.SCRIPT_ID }}
4145 run : |
4246 echo "✅ Deployment to GAS succeeded!"
43- echo "Script ID: $(jq -r '.scriptId' .clasp.json) "
47+ echo "Script ID: $SCRIPT_ID "
You can’t perform that action at this time.
0 commit comments