Skip to content

Commit a514af2

Browse files
authored
chore(ci): pin deps in workflow and add dependabot to update them weekly (#115)
Pinning hashes for dependencies in workflows is a security best practice Excluded from pinning are actions from the `github/*` and `actions/*` given that these are officially managed by Github and are not raised by `zizmor` By configuring dependabot with `package-ecosystem: "github-actions"` it will open a pull request only for updating pinned hashes (not cargo, etc..): https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot#enabling-dependabot-version-updates-for-actions The `<hash> #<branch_name>` syntax is what dependabot picks up on
1 parent ece63a2 commit a514af2

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- uses: actions/checkout@v5
3535
with:
3636
persist-credentials: false
37-
- uses: dtolnay/rust-toolchain@stable
38-
- uses: Swatinem/rust-cache@v2
37+
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
38+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
3939
# Only run tests on latest stable and above
4040
- name: build
4141
if: ${{ matrix.rust == '1.76' }} # MSRV
@@ -52,10 +52,10 @@ jobs:
5252
- uses: actions/checkout@v5
5353
with:
5454
persist-credentials: false
55-
- uses: dtolnay/rust-toolchain@stable
55+
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
5656
with:
5757
targets: wasm32-unknown-unknown
58-
- uses: Swatinem/rust-cache@v2
58+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
5959
with:
6060
cache-on-failure: true
6161
- name: check
@@ -68,9 +68,9 @@ jobs:
6868
- uses: actions/checkout@v5
6969
with:
7070
persist-credentials: false
71-
- uses: dtolnay/rust-toolchain@stable
72-
- uses: taiki-e/install-action@cargo-hack
73-
- uses: Swatinem/rust-cache@v2
71+
- uses: dtolnay/rust-toolchain@5d458579430fc14a04a08a1e7d3694f545e91ce6 # stable
72+
- uses: taiki-e/install-action@c9a06c0e5d38d182732372ae4390adb6ddbfd51b # cargo-hack
73+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
7474
with:
7575
cache-on-failure: true
7676
- name: cargo hack
@@ -83,8 +83,8 @@ jobs:
8383
- uses: actions/checkout@v5
8484
with:
8585
persist-credentials: false
86-
- uses: dtolnay/rust-toolchain@clippy
87-
- uses: Swatinem/rust-cache@v2
86+
- uses: dtolnay/rust-toolchain@45949235481cda149033232bdf068b00ceb0b28d # clippy
87+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
8888
with:
8989
cache-on-failure: true
9090
- run: cargo clippy --workspace --all-targets --all-features
@@ -98,8 +98,8 @@ jobs:
9898
- uses: actions/checkout@v5
9999
with:
100100
persist-credentials: false
101-
- uses: dtolnay/rust-toolchain@nightly
102-
- uses: Swatinem/rust-cache@v2
101+
- uses: dtolnay/rust-toolchain@55d80eb3c5a4228eec5390a083c092095115c6f1 # nightly
102+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2
103103
with:
104104
cache-on-failure: true
105105
- run: cargo doc --workspace --all-features --no-deps --document-private-items
@@ -113,13 +113,13 @@ jobs:
113113
- uses: actions/checkout@v5
114114
with:
115115
persist-credentials: false
116-
- uses: dtolnay/rust-toolchain@nightly
116+
- uses: dtolnay/rust-toolchain@55d80eb3c5a4228eec5390a083c092095115c6f1 # nightly
117117
with:
118118
components: rustfmt
119119
- run: cargo fmt --all --check
120120

121121
deny:
122-
uses: ithacaxyz/ci/.github/workflows/deny.yml@main
122+
uses: ithacaxyz/ci/.github/workflows/deny.yml@9c8d0dc20e7ad02455d3fdab2378a05f29907630 # main
123123

124124
ci-success:
125125
runs-on: ubuntu-latest
@@ -136,6 +136,6 @@ jobs:
136136
timeout-minutes: 30
137137
steps:
138138
- name: Decide whether the needed jobs succeeded or failed
139-
uses: re-actors/alls-green@release/v1
139+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
140140
with:
141141
jobs: ${{ toJSON(needs) }}

.github/workflows/codeql.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CodeQL
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches: ["main"]
@@ -19,9 +22,7 @@ jobs:
1922
runs-on: ubuntu-latest
2023
permissions:
2124
security-events: write
22-
packages: read
2325
actions: read
24-
contents: read
2526

2627
strategy:
2728
fail-fast: false

0 commit comments

Comments
 (0)