Skip to content

Commit c580f99

Browse files
caoxing9claude
andcommitted
ci(zapier): inject .zapierapprc from repo Variables instead of committing it
Keep the app id/key out of the public repo. CI writes .zapierapprc in the deploy job from the ZAPIER_APP_ID / ZAPIER_APP_KEY repo Variables (non-secret identifiers). Re-ignore the file; devs run `zapier-platform link` locally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b6c0185 commit c580f99

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/zapier.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ jobs:
6565
cache: npm
6666
cache-dependency-path: packages/zapier/package-lock.json
6767
- run: npm ci
68+
- name: Link app — write .zapierapprc from repo Variables
69+
run: |
70+
if [ -z "${{ vars.ZAPIER_APP_ID }}" ] || [ -z "${{ vars.ZAPIER_APP_KEY }}" ]; then
71+
echo "::error::Set repo Variables ZAPIER_APP_ID and ZAPIER_APP_KEY (Settings -> Secrets and variables -> Actions -> Variables)."
72+
exit 1
73+
fi
74+
printf '{"id": %s, "key": "%s"}\n' \
75+
"${{ vars.ZAPIER_APP_ID }}" "${{ vars.ZAPIER_APP_KEY }}" > .zapierapprc
6876
- name: Guard — never overwrite a version that has users
6977
env:
7078
ZAPIER_DEPLOY_KEY: ${{ secrets.ZAPIER_DEPLOY_KEY }}

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ node_modules/
99
.env.*
1010
!.env.example
1111

12-
# NOTE: .zapierapprc holds the app id/key (identifiers, NOT a secret) and is
13-
# committed so CI can `zapier push`. The deploy key lives in ~/.zapierrc / the
14-
# ZAPIER_DEPLOY_KEY CI secret — never in the repo.
12+
# Zapier app linkage — kept out of the repo. CI writes it from the
13+
# ZAPIER_APP_ID / ZAPIER_APP_KEY repo Variables; locally run `zapier-platform
14+
# link`. (The deploy key lives in ~/.zapierrc / the ZAPIER_DEPLOY_KEY secret.)
15+
.zapierapprc
1516

1617
# Build output
1718
build/

packages/zapier/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules/
22
.env
3+
.zapierapprc
34
dist/
45
build/
56
*.zip

packages/zapier/.zapierapprc

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)