Skip to content

Commit f7d2c71

Browse files
committed
Manage dependencies with cooldown, more pinning, more scanning
Various adjustments related to supply chain security and CI: - Don't persist credentials in `actions/checkout`. - Pin actions to full SHA-1 OIDs with tool-readable tag comments. - Change cadence from weekly to monthly (due to more updates now). - Enable Dependabot for Cargo (Rust) dependencies, not just GHA. - Set best-effort 7-day cooldown period in Dependabot updates. - Set up Zizmor with customized workflow and pedantic persona. - Turn off two unwanted pedantic Zizmor checks. - Allow both workflows to run from Actions tab (and other events).
1 parent e16e2ab commit f7d2c71

File tree

4 files changed

+66
-7
lines changed

4 files changed

+66
-7
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
version: 2
22
updates:
3+
- package-ecosystem: cargo
4+
directory: '/'
5+
schedule:
6+
interval: monthly
7+
commit-message:
8+
prefix: ''
9+
allow:
10+
- dependency-type: all
11+
groups:
12+
cargo:
13+
patterns: ['*']
14+
cooldown:
15+
default-days: 7
16+
317
- package-ecosystem: github-actions
418
directory: '/'
519
schedule:
6-
interval: weekly
20+
interval: monthly
21+
commit-message:
22+
prefix: ''
723
groups:
824
github-actions:
925
patterns: ['*']
26+
cooldown:
27+
default-days: 7

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
branches:
1111
- main
12+
workflow_dispatch:
1213

1314
permissions:
1415
contents: read
@@ -17,15 +18,17 @@ jobs:
1718
build-and-test-linux:
1819
runs-on: ubuntu-latest
1920
steps:
20-
- uses: actions/checkout@v6
21+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
with:
23+
persist-credentials: false
2124
- name: fmt
2225
run: cargo fmt --all -- --check
2326
- name: clippy
2427
run: cargo clippy
2528
- name: tests
2629
run: make tests
2730
- name: "Check (crossterm)"
28-
uses: actions-rs/cargo@v1
31+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
2932
with:
3033
command: test
3134
args: --features=render-tui,render-tui-crossterm,render-line,render-line-crossterm,signal-hook,render-line-autoconfigure,progress-tree --all --bins --tests --examples
@@ -35,19 +38,21 @@ jobs:
3538
build-and-test-on-windows:
3639
runs-on: windows-latest
3740
steps:
38-
- uses: actions/checkout@v6
39-
- uses: actions-rs/toolchain@v1
41+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
42+
with:
43+
persist-credentials: false
44+
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
4045
with:
4146
profile: default
4247
toolchain: stable
4348
override: true
4449
- name: "Check (crossterm)"
45-
uses: actions-rs/cargo@v1
50+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
4651
with:
4752
command: check
4853
args: --features=render-tui,render-tui-crossterm,render-line,render-line-crossterm,signal-hook,render-line-autoconfigure,progress-tree --all --bins --tests --examples
4954
- name: "Test (crossterm)"
50-
uses: actions-rs/cargo@v1
55+
uses: actions-rs/cargo@844f36862e911db73fe0815f00a4a2602c279505 # v1.0.3
5156
with:
5257
command: test
5358
args: --features=render-tui,render-tui-crossterm,render-line,render-line-crossterm,signal-hook,render-line-autoconfigure,progress-tree progress-tree" --all

.github/workflows/zizmor.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "run-ci/**"
8+
- "**/run-ci/**"
9+
pull_request:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
permissions: {} # Expanded in the `zizmor` job.
15+
16+
jobs:
17+
zizmor:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
security-events: write # Required for uploading SARIF to view in the Security tab.
21+
contents: read # Not needed in public repos. (Kept for private forks/reuploads.)
22+
actions: read # Not needed in public repos. (Kept for private forks/reuploads.)
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26+
with:
27+
persist-credentials: false
28+
- name: Run zizmor 🌈
29+
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
30+
with:
31+
persona: pedantic

.github/zizmor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rules:
2+
anonymous-definition:
3+
disable: true
4+
concurrency-limits:
5+
disable: true

0 commit comments

Comments
 (0)