Skip to content

Commit b463116

Browse files
committed
ci: update permissions and caching for CI jobs
1 parent fba2dfd commit b463116

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/cd.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ on:
99
- cron: '43 1 * * SUN' # every Sunday at 1:43 AM UTC
1010
workflow_dispatch:
1111

12+
# Set empty permissions to empty by default, and then set more granular permissions for each job
13+
permissions: {}
14+
15+
concurrency:
16+
group: cd-${{ github.ref }}
17+
1218
env:
1319
IMAGE_NAME: network-tools
1420

1521
jobs:
1622
# Test building on multiple architectures
1723
test:
1824
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
actions: read
1928
strategy:
2029
matrix:
2130
platform: [linux/amd64, linux/arm64]
@@ -35,8 +44,8 @@ jobs:
3544
context: .
3645
platforms: ${{ matrix.platform }}
3746
push: false
38-
cache-from: type=gha
39-
cache-to: type=gha,mode=max
47+
cache-from: type=gha,scope=${{ matrix.platform }}
48+
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
4049

4150
publish:
4251
needs: test
@@ -46,6 +55,8 @@ jobs:
4655
permissions:
4756
packages: write
4857
contents: read
58+
actions: read
59+
attestations: write
4960

5061
steps:
5162
- name: Check out repository

0 commit comments

Comments
 (0)