Skip to content

Commit 080b8f5

Browse files
apham0001KaloyanTanev
authored andcommitted
fix: pin GitHub Actions to SHA for supply chain security (#24)
* fix: pin GitHub Actions to SHA for supply chain security Pin all GitHub Actions to their full commit SHA instead of mutable tags to prevent supply chain attacks via tag manipulation. Actions pinned: - actions/checkout@v4 - actions/setup-go@v5 - golangci/golangci-lint-action@v8 - morphy2k/revive-action@v2 - aormsby/Fork-Sync-With-Upstream-action@v3.4.1 - rtCamp/action-slack-notify@v2 - n8maninger/action-golang-test@v2 * chore: add Renovate config for GitHub Actions updates
1 parent 48682f9 commit 080b8f5

6 files changed

Lines changed: 31 additions & 18 deletions

File tree

.github/renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:recommended"],
4+
"enabledManagers": ["github-actions"],
5+
"packageRules": [{
6+
"matchManagers": ["github-actions"],
7+
"matchDepTypes": ["github-actions"],
8+
"matchFileNames": [".github/workflows/**"],
9+
"schedule": ["every weekend"],
10+
"labels": ["renovate/github-actions"],
11+
"groupName": "GitHub Actions updates"
12+
}]
13+
}

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
name: lint
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-go@v5
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
1919
with:
2020
cache: false
2121
go-version: '1.25.2'
2222
- name: golangci-lint
23-
uses: golangci/golangci-lint-action@v8
23+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8
2424
with:
2525
version: "latest"
2626
args: "--timeout=60m"

.github/workflows/revive.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
revive:
1313
runs-on: ubuntu-22.04
1414
steps:
15-
- uses: actions/setup-go@v5
15+
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
1616
with:
1717
cache: false
1818
go-version: '1.25.2'
19-
- uses: actions/checkout@v4
20-
- uses: morphy2k/revive-action@v2
19+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
20+
- uses: morphy2k/revive-action@7b25e715309495d5c3cdef7caccb65ad9fa74ba3 # v2

.github/workflows/sync-rebase.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout target repo
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
1717
with:
1818
ref: master
1919

@@ -24,7 +24,7 @@ jobs:
2424
2525
- name: Sync upstream changes
2626
id: sync
27-
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4.1
27+
uses: aormsby/Fork-Sync-With-Upstream-action@1090e365224fc834e7e1de521c417ded2d6fcb53 # v3.4.1
2828
with:
2929
target_sync_branch: master
3030
target_repo_token: ${{ secrets.OBOL_PLATFORM_PAT }}
@@ -38,7 +38,7 @@ jobs:
3838
if: needs.sync_latest_from_upstream.outputs.has_new_commits == 'true'
3939
steps:
4040
- name: Checkout code
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
4242
with:
4343
fetch-depth: 0
4444
ref: obol
@@ -83,7 +83,7 @@ jobs:
8383
8484
- name: Rebase failed error
8585
if: (contains(steps.rebase.outputs.RESULT, 'error:') || contains(steps.rebase.outputs.RESULT, 'fatal:')) && !contains(steps.rebase.outputs.RESULT, 'Merge conflict in')
86-
uses: rtCamp/action-slack-notify@v2
86+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
8787
env:
8888
SLACK_CHANNEL: dev-stack-releases
8989
SLACK_COLOR: eb3d2c #red
@@ -94,7 +94,7 @@ jobs:
9494

9595
- name: Rebase failed conflict
9696
if: contains(steps.rebase.outputs.RESULT, 'Merge conflict in')
97-
uses: rtCamp/action-slack-notify@v2
97+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
9898
env:
9999
SLACK_CHANNEL: dev-stack-releases
100100
SLACK_COLOR: ecc926 #yellow

.github/workflows/tag.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2222
with:
2323
ref: master
2424

@@ -104,7 +104,7 @@ jobs:
104104

105105
steps:
106106
- name: Checkout
107-
uses: actions/checkout@v4
107+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
108108
with:
109109
fetch-depth: 0
110110
ref: obol
@@ -152,7 +152,7 @@ jobs:
152152
153153
- name: Rebase failed error
154154
if: (contains(steps.rebase.outputs.RESULT, 'error:') || contains(steps.rebase.outputs.RESULT, 'fatal:')) && !contains(steps.rebase.outputs.RESULT, 'Merge conflict in')
155-
uses: rtCamp/action-slack-notify@v2
155+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
156156
env:
157157
SLACK_CHANNEL: dev-stack-releases
158158
SLACK_COLOR: eb3d2c #red
@@ -163,7 +163,7 @@ jobs:
163163

164164
- name: Rebase failed conflict
165165
if: contains(steps.rebase.outputs.RESULT, 'Merge conflict in')
166-
uses: rtCamp/action-slack-notify@v2
166+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
167167
env:
168168
SLACK_CHANNEL: dev-stack-releases
169169
SLACK_COLOR: ecc926 #yellow

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ jobs:
88
test:
99
runs-on: ubuntu-22.04
1010
steps:
11-
- uses: actions/setup-go@v5
11+
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
1212
with:
1313
cache: false
1414
go-version: '1.25.2'
15-
- uses: actions/checkout@v4
16-
- uses: n8maninger/action-golang-test@v2
15+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
16+
- uses: n8maninger/action-golang-test@aa292dc81b16d34406a9551e629e0cdca00d9418 # v2
1717
with:
1818
args: "-race;-timeout=30m"
1919

0 commit comments

Comments
 (0)