Skip to content

Commit 2f80d44

Browse files
sserrataclaude
andcommitted
ci: harden deploy workflows with credential surface reduction
- Add export_environment_variables: false to google-github-actions/auth to prevent automatic export of CLOUDSDK_*/GCP_PROJECT env vars - Mask credentials_file_path and GCP_PROJECT_NUMBER in logs - Move Firebase projectId and site target to repository secrets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a2cf328 commit 2f80d44

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/deploy-live.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ jobs:
7575
with:
7676
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
7777
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
78+
export_environment_variables: false
7879

7980
- name: Read GCP credentials
8081
id: creds
8182
run: |
83+
echo "::add-mask::${{ steps.auth.outputs.credentials_file_path }}"
84+
echo "::add-mask::${{ secrets.GCP_PROJECT_NUMBER }}"
8285
creds=$(cat "${{ steps.auth.outputs.credentials_file_path }}")
8386
echo "::add-mask::$creds"
8487
echo "sa_key=$creds" >> "$GITHUB_OUTPUT"
@@ -96,9 +99,9 @@ jobs:
9699
with:
97100
repoToken: "${{ secrets.GITHUB_TOKEN }}"
98101
firebaseServiceAccount: "${{ steps.creds.outputs.sa_key }}"
99-
projectId: pandev
102+
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
100103
channelId: live
101-
target: docusaurus-openapi.tryingpan.dev
104+
target: ${{ secrets.FIREBASE_SITE }}
102105
env:
103106
FIREBASE_CLI_PREVIEWS: hostingchannels
104107

.github/workflows/deploy-preview.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,13 @@ jobs:
170170
with:
171171
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
172172
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
173+
export_environment_variables: false
173174

174175
- name: Read GCP credentials
175176
id: creds
176177
run: |
178+
echo "::add-mask::${{ steps.auth.outputs.credentials_file_path }}"
179+
echo "::add-mask::${{ secrets.GCP_PROJECT_NUMBER }}"
177180
creds=$(cat "${{ steps.auth.outputs.credentials_file_path }}")
178181
echo "::add-mask::$creds"
179182
echo "sa_key=$creds" >> "$GITHUB_OUTPUT"
@@ -191,7 +194,7 @@ jobs:
191194
with:
192195
repoToken: "${{ secrets.GITHUB_TOKEN }}"
193196
firebaseServiceAccount: "${{ steps.creds.outputs.sa_key }}"
194-
projectId: pandev
197+
projectId: ${{ secrets.FIREBASE_PROJECT_ID }}
195198
expires: 7d
196199
channelId: "pr${{ github.event.number }}"
197200
totalPreviewChannelLimit: 25

0 commit comments

Comments
 (0)