Skip to content

Commit 179da5f

Browse files
committed
[CI]: Update GitHub Actions workflows to enhance security and update dependencies
Signed-off-by: Moshe Vayner <moshe@vayner.me>
1 parent 5170a16 commit 179da5f

2 files changed

Lines changed: 28 additions & 12 deletions

File tree

.github/workflows/automerge.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,20 @@ jobs:
1010

1111
runs-on: ubuntu-latest
1212

13+
permissions:
14+
contents: write
15+
1316
steps:
17+
- name: Harden Runner
18+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
19+
with:
20+
disable-sudo: true
21+
egress-policy: block
22+
allowed-endpoints: >
23+
api.github.com:443
24+
github.com:443
1425
- name: Checkout
15-
uses: actions/checkout@v6
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1627
with:
1728
fetch-depth: 0 # Full clone necessary for proper merge
1829

.github/workflows/build-test.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ jobs:
2020
outputs:
2121
paths: ${{ steps.filter.outputs.changes }}
2222
steps:
23-
- uses: actions/checkout@v6
24-
with:
25-
ref: ${{ github.event.pull_request.head.sha }}
2623
- name: Harden Runner
27-
uses: step-security/harden-runner@v2
24+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
2825
with:
2926
disable-sudo: true
3027
egress-policy: block
3128
allowed-endpoints: >
3229
api.github.com:443
3330
github.com:443
34-
- uses: dorny/paths-filter@v3
31+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
with:
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
3535
id: filter
3636
with:
3737
base: ${{ github.ref }}
@@ -43,7 +43,7 @@ jobs:
4343
if: ${{ contains(fromJSON(needs.changes.outputs.paths), 'src') }}
4444
steps:
4545
- name: Harden Runner
46-
uses: step-security/harden-runner@v2
46+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
4747
with:
4848
disable-sudo: true
4949
egress-policy: block
@@ -61,10 +61,10 @@ jobs:
6161
get.helm.sh:443
6262
golangci-lint.run:443
6363
64-
- uses: actions/checkout@v6
64+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
6565
with:
6666
fetch-depth: 0
67-
- uses: actions/setup-go@v6
67+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
6868
with:
6969
go-version-file: go.mod
7070
check-latest: true
@@ -90,20 +90,25 @@ jobs:
9090
docker-build:
9191
runs-on: ubuntu-latest
9292
steps:
93-
- uses: actions/checkout@v6
93+
- name: Harden Runner
94+
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
95+
with:
96+
disable-sudo: true
97+
egress-policy: audit
98+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9499
with:
95100
fetch-depth: 0
96101
- name: Docker Meta
97102
id: meta
98-
uses: docker/metadata-action@v5
103+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
99104
with:
100105
images: |
101106
linode/linode-cloud-controller-manager
102107
tags: |
103108
type=raw,value=pr-${{ github.event.pull_request.number }},enable=${{ github.event_name == 'pull_request' }}
104109
type=raw,value=latest,enable=${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
105110
- name: Build Dockerfile
106-
uses: docker/build-push-action@v6
111+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
107112
with:
108113
context: .
109114
push: false

0 commit comments

Comments
 (0)