Skip to content

Commit eafc55c

Browse files
sserrataclaude
andauthored
fix(ci): harden workflow security across deploy and release pipelines (#1345)
- Remove GCP_SA_KEY from GITHUB_ENV in deploy-live and deploy-preview; google-github-actions/auth already exports GOOGLE_APPLICATION_CREDENTIALS via ADC, so the explicit credential export step was unnecessary and exposed the SA JSON in plaintext to all subsequent steps - Add --ignore-scripts to yarn install in deploy-preview build job to prevent postinstall lifecycle hooks from executing untrusted PR code - Delete combine-dependabot-prs.yml: workflow was non-functional due to JS syntax errors and depended on an archived third-party action - Add explicit permissions: contents: read to deploy-live build job - Replace hardcoded personal git identity in canary-release with github-actions[bot] identity Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 584705f commit eafc55c

4 files changed

Lines changed: 5 additions & 158 deletions

File tree

.github/workflows/canary-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ jobs:
2727
cache: yarn
2828
- name: Prepare git
2929
run: |
30-
git config --global user.name "Steven Serrata"
31-
git config --global user.email "sserrata@paloaltonetworks.com"
30+
git config --global user.name "github-actions[bot]"
31+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
3232
git fetch
3333
git checkout main
3434
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> .npmrc

.github/workflows/combine-dependabot-prs.yml

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

.github/workflows/deploy-live.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
if: github.repository == 'PaloAltoNetworks/docusaurus-openapi-docs'
1010
name: Build
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1214

1315
steps:
1416
- name: Checkout repository
@@ -59,9 +61,6 @@ jobs:
5961
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
6062
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
6163

62-
- name: Export Google Cloud Credentials
63-
run: echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
64-
6564
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
6665
with:
6766
name: build
@@ -74,7 +73,6 @@ jobs:
7473
uses: FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0
7574
with:
7675
repoToken: "${{ secrets.GITHUB_TOKEN }}"
77-
firebaseServiceAccount: "${{ env.GCP_SA_KEY }}"
7876
projectId: pandev
7977
channelId: live
8078
target: docusaurus-openapi.tryingpan.dev

.github/workflows/deploy-preview.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
cache: "yarn"
113113

114114
- name: Install dependencies
115-
run: yarn --prefer-offline
115+
run: yarn --prefer-offline --ignore-scripts
116116

117117
- name: Build packages
118118
run: yarn build-packages
@@ -155,9 +155,6 @@ jobs:
155155
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
156156
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}
157157

158-
- name: Export Google Cloud Credentials
159-
run: echo "GCP_SA_KEY=$(cat ${{ steps.auth.outputs.credentials_file_path }})" >> $GITHUB_ENV
160-
161158
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4
162159
with:
163160
name: build
@@ -170,7 +167,6 @@ jobs:
170167
uses: FirebaseExtended/action-hosting-deploy@e2eda2e106cfa35cdbcf4ac9ddaf6c4756df2c8c # v0.10.0
171168
with:
172169
repoToken: "${{ secrets.GITHUB_TOKEN }}"
173-
firebaseServiceAccount: "${{ env.GCP_SA_KEY }}"
174170
projectId: pandev
175171
expires: 30d
176172
channelId: "pr${{ github.event.number }}"

0 commit comments

Comments
 (0)