Skip to content

Commit ac93fbf

Browse files
committed
ci: pin github actions to commit SHAs for supply-chain safety
replace mutable version tags with full commit SHAs to prevent upstream retargeting attacks (CWE-494/CWE-829): - actions/checkout@v5 → 93cb6efe - actions/setup-go@v6 → 4a360112 - golangci/golangci-lint-action@v9 → 1e7e51e7 - actions/upload-artifact@v4 → ea165f8d applied to both maas-api-ci.yml and maas-controller-ci.yml. Signed-off-by: Chaitanya Kulkarni <ckulkarn@redhat.com> Signed-off-by: Chaitanya Kulkarni <chkulkar@redhat.com> Made-with: Cursor
1 parent 89434a2 commit ac93fbf

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

.github/workflows/maas-api-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ jobs:
2121
lint:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2525

2626
- name: Align golangci-lint version with Makefile
2727
id: golangci-version
2828
run: |
2929
VERSION=$(grep '^GOLANGCI_LINT_VERSION' tools.mk | cut -d'=' -f2 | tr -d ' ?')
3030
echo "version=$VERSION" >> $GITHUB_OUTPUT
3131
32-
- uses: actions/setup-go@v6
32+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3333
with:
3434
go-version-file: maas-api/go.mod
3535
cache: true
3636
cache-dependency-path: maas-api/go.sum
3737

3838
- name: golangci-lint
39-
uses: golangci/golangci-lint-action@v9
39+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
4040
with:
4141
version: ${{ steps.golangci-version.outputs.version }}
4242
working-directory: ${{ env.PROJECT_DIR }}
4343
test:
4444
runs-on: ubuntu-latest
4545
steps:
46-
- uses: actions/checkout@v5
46+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
4747

48-
- uses: actions/setup-go@v6
48+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
4949
with:
5050
go-version-file: ${{ env.PROJECT_DIR }}/go.mod
5151
cache: true
@@ -55,7 +55,7 @@ jobs:
5555
run: make test
5656

5757
- name: Upload coverage reports
58-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5959
if: always()
6060
with:
6161
name: coverage-reports

.github/workflows/maas-controller-ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,32 @@ jobs:
2121
lint:
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2525

2626
- name: Align golangci-lint version with Makefile
2727
id: golangci-version
2828
run: |
2929
VERSION=$(grep '^GOLANGCI_LINT_VERSION' tools.mk | cut -d'=' -f2 | tr -d ' ?')
3030
echo "version=$VERSION" >> $GITHUB_OUTPUT
3131
32-
- uses: actions/setup-go@v6
32+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3333
with:
3434
go-version-file: maas-controller/go.mod
3535
cache: true
3636
cache-dependency-path: maas-controller/go.sum
3737

3838
- name: golangci-lint
39-
uses: golangci/golangci-lint-action@v9
39+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
4040
with:
4141
version: ${{ steps.golangci-version.outputs.version }}
4242
working-directory: ${{ env.PROJECT_DIR }}
4343

4444
test:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v5
47+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
4848

49-
- uses: actions/setup-go@v6
49+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
5050
with:
5151
go-version-file: ${{ env.PROJECT_DIR }}/go.mod
5252
cache: true
@@ -56,7 +56,7 @@ jobs:
5656
run: make test
5757

5858
- name: Upload coverage reports
59-
uses: actions/upload-artifact@v4
59+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
6060
if: always()
6161
with:
6262
name: maas-controller-coverage

0 commit comments

Comments
 (0)