Skip to content

Commit 2a9c23e

Browse files
authored
chore(ci): update GitHub Actions to specific commit SHAs for improved reliability (#54)
This pull request updates all GitHub Actions used in the workflow files to pin them to specific commit SHAs and upgrade to newer versions where available. This improves security by preventing accidental upgrades and ensures more consistent and reliable CI/CD runs. **GitHub Actions version pinning and upgrades:** - All actions in `.github/workflows/pr.yaml`, `.github/workflows/release.yaml`, `.github/workflows/snapshot.yaml`, and `.github/workflows/test.yaml` have been updated to use specific commit SHAs, ensuring reproducibility and improved security. [[1]](diffhunk://#diff-1eb4e5fd5611777d4e597ef299a1cb5ba8050c28a2dabbd4fbc56205d69e5ddaL18-R18) [[2]](diffhunk://#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL19-R19) [[3]](diffhunk://#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL38-R58) [[4]](diffhunk://#diff-8da12a3c4afea00f93c8ec7c9a320c45d3209a66fefd270b60faff9728895914L15-R33) [[5]](diffhunk://#diff-245392b692a50c38ecab4381b118862db514035c10983f3bd4f4b7f1f4be4692L17-R22) [[6]](diffhunk://#diff-245392b692a50c38ecab4381b118862db514035c10983f3bd4f4b7f1f4be4692L42-R47) **Workflow-specific action updates:** - Upgraded `amannn/action-semantic-pull-request` to v6.1.1 and pinned by SHA in `pr.yaml`. - Upgraded `googleapis/release-please-action` to v4.4.0 and pinned by SHA in `release.yaml`. - Upgraded and pinned versions of `actions/checkout`, `actions/setup-go`, `sigstore/cosign-installer`, `docker/login-action`, and `goreleaser/goreleaser-action` in both `release.yaml` and `snapshot.yaml`. [[1]](diffhunk://#diff-e426ed45842837026e10e66af23d9c7077e89eacbe6958ce7cb991130ad05adaL38-R58) [[2]](diffhunk://#diff-8da12a3c4afea00f93c8ec7c9a320c45d3209a66fefd270b60faff9728895914L15-R33) - Upgraded `SonarSource/sonarqube-scan-action` to v7.0.0 and `actions/upload-artifact` to v6.0.0 in `test.yaml`, both pinned by SHA. - Updated `actions/checkout` and `actions/setup-go` to newer pinned versions in `test.yaml`.
1 parent e1cea98 commit 2a9c23e

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
permissions:
1616
pull-requests: read
1717
steps:
18-
- uses: amannn/action-semantic-pull-request@v5
18+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2121
with:

.github/workflows/release.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
outputs:
1717
release_created: ${{ steps.release.outputs.release_created }}
1818
steps:
19-
- uses: googleapis/release-please-action@v4
19+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
2020
id: release
2121
with:
2222
config-file: .github/release-please/config.json
@@ -35,27 +35,27 @@ jobs:
3535
steps:
3636

3737
- name: Checkout
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3939
with:
4040
fetch-depth: 0
4141

4242
- name: Install Go
43-
uses: actions/setup-go@v5
43+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
4444
with:
4545
go-version-file: go.mod
4646

4747
- name: Install Cosign
48-
uses: sigstore/cosign-installer@v3.9.1
48+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
4949

5050
- name: Login to GitHub Container Registry
51-
uses: docker/login-action@v3
51+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
5252
with:
5353
registry: ghcr.io
5454
username: ${{ github.actor }}
5555
password: ${{ secrets.GITHUB_TOKEN }}
5656

5757
- name: Run GoReleaser
58-
uses: goreleaser/goreleaser-action@v6
58+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
5959
with:
6060
version: "~> v2"
6161
args: release --clean

.github/workflows/snapshot.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ jobs:
1212
steps:
1313

1414
- name: Checkout
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1616
with:
1717
fetch-depth: 0
1818

1919
- name: Set up Go
20-
uses: actions/setup-go@v5
20+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
2121
with:
2222
go-version-file: go.mod
2323

2424
- name: Run GoReleaser
25-
uses: goreleaser/goreleaser-action@v6
25+
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
2626
with:
2727
version: "~> v2"
2828
args: release --clean --snapshot
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131

3232
- name: Upload assets
33-
uses: actions/upload-artifact@v4
33+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3434
with:
3535
name: dist
3636
path: dist/*

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
steps:
1515

1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1818
with:
1919
fetch-depth: 0
2020

2121
- name: Set up Go
22-
uses: actions/setup-go@v5
22+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
2323
with:
2424
go-version-file: go.mod
2525

@@ -39,12 +39,12 @@ jobs:
3939
-o coverage.html
4040
4141
- name: SonarCloud Scan
42-
uses: SonarSource/sonarqube-scan-action@v5.2.0
42+
uses: SonarSource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
4343
env:
4444
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
4545

4646
- name: Upload assets
47-
uses: actions/upload-artifact@v4
47+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
4848
with:
4949
name: coverage
5050
path: coverage.*

0 commit comments

Comments
 (0)