Skip to content

Commit 89e3a14

Browse files
authored
fix: workflows security issues (#592)
* ci: fix unpinned tag for a non-immutable action in workflow * ci: fix workflow does not contain permissions
1 parent 0e61c78 commit 89e3a14

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ on:
66
push:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: ci-${{ github.event.pull_request.number || github.ref }}
1114
cancel-in-progress: true
1215

1316
env:
14-
GO_VERSION: "1.23" # https://go.dev/dl/
17+
GO_VERSION: "1.23" # https://go.dev/dl/
1518
FOUNDRY_VERSION: stable
1619

1720
jobs:
@@ -35,10 +38,10 @@ jobs:
3538
runs-on: ubuntu-latest
3639
steps:
3740
- uses: actions/checkout@v4
38-
41+
3942
- name: gen-doc
4043
run: make gen-doc
41-
44+
4245
- name: Check if generated files are up to date
4346
run: |
4447
if [[ -n $(git status --porcelain) ]]; then
@@ -56,7 +59,7 @@ jobs:
5659
runs-on: ubuntu-latest
5760
steps:
5861
- uses: actions/checkout@v4
59-
62+
6063
- name: gen-proto
6164
run: make gen-proto
6265

@@ -77,10 +80,10 @@ jobs:
7780
runs-on: ubuntu-latest
7881
steps:
7982
- uses: actions/checkout@v4
80-
83+
8184
- name: gen-go-bindings
8285
run: make gen-go-bindings
83-
86+
8487
- name: Check if generated files are up to date
8588
run: |
8689
if [[ -n $(git status --porcelain) ]]; then
@@ -101,7 +104,7 @@ jobs:
101104

102105
- name: gen-load-test-modes
103106
run: make gen-load-test-modes
104-
107+
105108
- name: Check if generated files are up to date
106109
run: |
107110
if [[ -n $(git status --porcelain) ]]; then
@@ -122,7 +125,7 @@ jobs:
122125

123126
- name: gen-json-rpc-types
124127
run: make gen-json-rpc-types
125-
128+
126129
- name: Check if generated files are up to date
127130
run: |
128131
if [[ -n $(git status --porcelain) ]]; then
@@ -158,7 +161,7 @@ jobs:
158161
with:
159162
go-version: ${{ env.GO_VERSION }}
160163
- name: Install Foundry
161-
uses: foundry-rs/foundry-toolchain@v1
164+
uses: foundry-rs/foundry-toolchain@de808b1eea699e761c404bda44ba8f21aba30b2c # v1.3
162165
with:
163166
version: ${{ env.FOUNDRY_VERSION }}
164167
- name: Install Geth

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: echo "tag=$(git describe --tags --exact-match HEAD)" >> $GITHUB_ENV
4141

4242
- name: Publish binaries
43-
uses: svenstaro/upload-release-action@v2
43+
uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # 2.9.0
4444
with:
4545
repo_token: ${{ secrets.GITHUB_TOKEN }}
4646
tag: ${{ env.tag }}

0 commit comments

Comments
 (0)