Skip to content

Commit 9ecb7d2

Browse files
sserrataclaude
andauthored
Harden GitHub Actions workflows and add CODEOWNERS (PaloAltoNetworks#1190)
- Add top-level permissions: {} to all workflows - Add persist-credentials: false to CodeQL checkout - Add frozen-lockfile to preview build install - Add per-PR concurrency group to deploy-preview - Update stale action version tag comments - Add version comment to google-github-actions/auth - Create CODEOWNERS for build-critical paths - Fix pre-existing tab character in CodeQL condition Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f48d493 commit 9ecb7d2

4 files changed

Lines changed: 40 additions & 21 deletions

File tree

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.github/ @PaloAltoNetworks/pan-dev
2+
/package.json @PaloAltoNetworks/pan-dev
3+
/yarn.lock @PaloAltoNetworks/pan-dev
4+
/firebase.json @PaloAltoNetworks/pan-dev
5+
/.firebaserc @PaloAltoNetworks/pan-dev
6+
/docusaurus.config.ts @PaloAltoNetworks/pan-dev
7+
/scripts/ @PaloAltoNetworks/pan-dev

.github/workflows/codeql-analysis.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
schedule:
77
- cron: "0 6 * * 1" # weekly Monday 6am UTC
88

9+
permissions: {}
10+
911
jobs:
1012
analyze:
11-
if: github.repository_owner == 'PaloAltoNetworks'
13+
if: github.repository_owner == 'PaloAltoNetworks'
1214
name: Analyze
1315
runs-on: ubuntu-latest
1416
permissions:
@@ -22,13 +24,15 @@ jobs:
2224

2325
steps:
2426
- name: Checkout repository
25-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
with:
29+
persist-credentials: false
2630

2731
- name: Initialize CodeQL
28-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3
32+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
2933
with:
3034
languages: ${{ matrix.language }}
3135
queries: security-extended
3236

3337
- name: Perform CodeQL Analysis
34-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3
38+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

.github/workflows/deploy-live.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches: [ master ]
66
workflow_dispatch:
77

8+
permissions: {}
9+
810
concurrency:
911
group: deploy-live
1012
cancel-in-progress: false
@@ -19,12 +21,12 @@ jobs:
1921

2022
steps:
2123
- name: Checkout repository
22-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2325
with:
2426
persist-credentials: false
2527

2628
- name: Setup node
27-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
29+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2830
with:
2931
node-version: '20'
3032
cache: 'yarn'
@@ -100,12 +102,12 @@ jobs:
100102

101103
steps:
102104
- name: Checkout repository
103-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
105+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104106
with:
105107
persist-credentials: false
106108

107109
- name: Setup node
108-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
110+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
109111
with:
110112
node-version: '20'
111113
cache: 'yarn'
@@ -119,7 +121,7 @@ jobs:
119121

120122
- name: Authenticate to Google Cloud
121123
id: auth
122-
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
124+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
123125
with:
124126
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
125127
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}

.github/workflows/deploy-preview.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
pull_request_target:
55
branches: [ master ]
66

7+
permissions: {}
8+
9+
concurrency:
10+
group: preview-${{ github.event.number }}
11+
cancel-in-progress: true
12+
713
jobs:
814
precheck:
915
if: ${{ github.repository == 'PaloAltoNetworks/pan.dev' }}
@@ -61,19 +67,19 @@ jobs:
6167

6268
steps:
6369
- name: Checkout repository
64-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
70+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6571
with:
6672
ref: ${{ github.event.pull_request.head.sha }}
6773
persist-credentials: false
6874

6975
- name: Initialize CodeQL
70-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3
76+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
7177
with:
7278
languages: ${{ matrix.language }}
7379
queries: security-extended
7480

7581
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3
82+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
7783

7884
analyze_unsafe:
7985
if: github.repository == 'PaloAltoNetworks/pan.dev' && needs.precheck.outputs.is-org-member-result == 'false'
@@ -92,19 +98,19 @@ jobs:
9298

9399
steps:
94100
- name: Checkout repository
95-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
101+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
96102
with:
97103
ref: ${{ github.event.pull_request.head.sha }}
98104
persist-credentials: false
99105

100106
- name: Initialize CodeQL
101-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3
107+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
102108
with:
103109
languages: ${{ matrix.language }}
104110
queries: security-extended
105111

106112
- name: Perform CodeQL Analysis
107-
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3
113+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
108114

109115
build:
110116
name: Build
@@ -119,13 +125,13 @@ jobs:
119125

120126
steps:
121127
- name: Checkout repository
122-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
128+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
123129
with:
124130
ref: ${{ github.event.pull_request.head.sha }}
125131
persist-credentials: false
126132

127133
- name: Setup node
128-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
134+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
129135
with:
130136
node-version: '20'
131137
cache: 'yarn'
@@ -135,7 +141,7 @@ jobs:
135141
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
136142

137143
- name: Install dependencies
138-
run: yarn --prefer-offline --ignore-scripts
144+
run: yarn --prefer-offline --frozen-lockfile --ignore-scripts
139145

140146
- name: Include netsec
141147
if: contains(github.event.pull_request.labels.*.name, 'netsec')
@@ -249,12 +255,12 @@ jobs:
249255

250256
steps:
251257
- name: Checkout repository
252-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4
258+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
253259
with:
254260
persist-credentials: false
255261

256262
- name: Setup node
257-
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v4
263+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
258264
with:
259265
node-version: '20'
260266
cache: 'yarn'
@@ -279,7 +285,7 @@ jobs:
279285
280286
- name: Authenticate to Google Cloud
281287
id: auth
282-
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
288+
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
283289
with:
284290
workload_identity_provider: ${{ secrets.WIF_PROVIDER }}
285291
service_account: ${{ secrets.WIF_SERVICE_ACCOUNT }}

0 commit comments

Comments
 (0)