Skip to content

Commit 6ded074

Browse files
authored
Merge pull request #85 from epage/template
chore: Update from '_rust/main' template
2 parents c2d9ca1 + 9eef936 commit 6ded074

File tree

11 files changed

+120
-55
lines changed

11 files changed

+120
-55
lines changed

.github/renovate.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
extends: ["helpers:pinGitHubActionDigests"],
23
schedule: [
34
'before 5am on the first day of the month',
45
],
@@ -64,7 +65,7 @@
6465
matchDepNames: [
6566
'prek',
6667
],
67-
extractVersion: '^(?<version>\\d+\\.\\d+\\.\\d+)',
68+
extractVersion: '^v(?<version>\\d+\\.\\d+\\.\\d+)',
6869
schedule: [
6970
'* * * * *',
7071
],

.github/workflows/audit.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Security audit
1+
name: Audit
22

33
permissions:
44
contents: read
@@ -22,19 +22,37 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
jobs:
25-
security_audit:
25+
audit:
26+
permissions:
27+
contents: none
28+
name: Audit
29+
needs: [advisories, cargo_deny, actions]
30+
runs-on: ubuntu-latest
31+
if: "always()"
32+
steps:
33+
- name: Failed
34+
run: exit 1
35+
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped')"
36+
advisories:
2637
permissions:
2738
issues: write # to create issues (actions-rs/audit-check)
2839
checks: write # to create check (actions-rs/audit-check)
2940
runs-on: ubuntu-latest
3041
# Prevent sudden announcement of a new advisory from failing ci:
3142
continue-on-error: true
43+
strategy:
44+
matrix:
45+
checks:
46+
- advisories
3247
steps:
3348
- name: Checkout repository
34-
uses: actions/checkout@v6
35-
- uses: actions-rs/audit-check@v1
49+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
50+
with:
51+
persist-credentials: false
52+
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2
3653
with:
37-
token: ${{ secrets.GITHUB_TOKEN }}
54+
command: check ${{ matrix.checks }}
55+
rust-version: stable
3856

3957
cargo_deny:
4058
permissions:
@@ -46,8 +64,25 @@ jobs:
4664
checks:
4765
- bans licenses sources
4866
steps:
49-
- uses: actions/checkout@v6
50-
- uses: EmbarkStudios/cargo-deny-action@v2
67+
- name: Checkout repository
68+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
69+
with:
70+
persist-credentials: false
71+
- uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2
5172
with:
5273
command: check ${{ matrix.checks }}
5374
rust-version: stable
75+
76+
actions:
77+
runs-on: ubuntu-latest
78+
permissions:
79+
security-events: write
80+
contents: read # only needed for private or internal repos
81+
actions: read # only needed for private or internal repos
82+
steps:
83+
- name: Checkout repository
84+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
85+
with:
86+
persist-credentials: false
87+
- name: Run zizmor
88+
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2

.github/workflows/ci.yml

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ jobs:
4545
CARGO_PROFILE_DEV_DEBUG: line-tables-only
4646
steps:
4747
- name: Checkout repository
48-
uses: actions/checkout@v6
48+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
49+
with:
50+
persist-credentials: false
4951
- name: Install Rust
50-
uses: dtolnay/rust-toolchain@stable
52+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
5153
with:
5254
toolchain: ${{ matrix.rust }}
53-
- uses: Swatinem/rust-cache@v2
54-
- uses: taiki-e/install-action@cargo-hack
55+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
56+
- uses: taiki-e/install-action@4448ce47d533cbe63d6dfafa732cf574a34606b5 # cargo-hack
5557
- name: Build
5658
run: cargo test --workspace --no-run
5759
- name: Test
@@ -64,13 +66,15 @@ jobs:
6466
runs-on: ${{ matrix.os }}
6567
steps:
6668
- name: Checkout repository
67-
uses: actions/checkout@v6
69+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
70+
with:
71+
persist-credentials: false
6872
- name: Install Rust
69-
uses: dtolnay/rust-toolchain@stable
73+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
7074
with:
7175
toolchain: stable
72-
- uses: Swatinem/rust-cache@v2
73-
- uses: taiki-e/install-action@cargo-hack
76+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
77+
- uses: taiki-e/install-action@4448ce47d533cbe63d6dfafa732cf574a34606b5 # cargo-hack
7478
- name: Default features
7579
run: cargo hack check --each-feature --locked --rust-version --ignore-private --workspace --all-targets --keep-going
7680
minimal-versions:
@@ -81,13 +85,15 @@ jobs:
8185
runs-on: ${{ matrix.os }}
8286
steps:
8387
- name: Checkout repository
84-
uses: actions/checkout@v6
88+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
89+
with:
90+
persist-credentials: false
8591
- name: Install stable Rust
86-
uses: dtolnay/rust-toolchain@stable
92+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
8793
with:
8894
toolchain: stable
8995
- name: Install nightly Rust
90-
uses: dtolnay/rust-toolchain@stable
96+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
9197
with:
9298
toolchain: nightly
9399
- name: Downgrade dependencies to minimal versions
@@ -98,25 +104,29 @@ jobs:
98104
runs-on: ubuntu-latest
99105
steps:
100106
- name: Checkout repository
101-
uses: actions/checkout@v6
107+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
108+
with:
109+
persist-credentials: false
102110
- name: Install Rust
103-
uses: dtolnay/rust-toolchain@stable
111+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
104112
with:
105113
toolchain: stable
106-
- uses: Swatinem/rust-cache@v2
114+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
107115
- name: "Is lockfile updated?"
108116
run: cargo update --workspace --locked
109117
docs:
110118
name: Docs
111119
runs-on: ubuntu-latest
112120
steps:
113121
- name: Checkout repository
114-
uses: actions/checkout@v6
122+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
123+
with:
124+
persist-credentials: false
115125
- name: Install Rust
116-
uses: dtolnay/rust-toolchain@stable
126+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
117127
with:
118128
toolchain: "1.94" # STABLE
119-
- uses: Swatinem/rust-cache@v2
129+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
120130
- name: Check documentation
121131
env:
122132
RUSTDOCFLAGS: -D warnings
@@ -126,13 +136,15 @@ jobs:
126136
runs-on: ubuntu-latest
127137
steps:
128138
- name: Checkout repository
129-
uses: actions/checkout@v6
139+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
140+
with:
141+
persist-credentials: false
130142
- name: Install Rust
131-
uses: dtolnay/rust-toolchain@stable
143+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
132144
with:
133145
toolchain: "1.94" # STABLE
134146
components: rustfmt
135-
- uses: Swatinem/rust-cache@v2
147+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
136148
- name: Check formatting
137149
run: cargo fmt --check
138150
clippy:
@@ -142,13 +154,15 @@ jobs:
142154
security-events: write # to upload sarif results
143155
steps:
144156
- name: Checkout repository
145-
uses: actions/checkout@v6
157+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
158+
with:
159+
persist-credentials: false
146160
- name: Install Rust
147-
uses: dtolnay/rust-toolchain@stable
161+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
148162
with:
149163
toolchain: "1.94" # STABLE
150164
components: clippy
151-
- uses: Swatinem/rust-cache@v2
165+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
152166
- name: Install SARIF tools
153167
run: cargo install clippy-sarif --locked
154168
- name: Install SARIF tools
@@ -161,7 +175,7 @@ jobs:
161175
| sarif-fmt
162176
continue-on-error: true
163177
- name: Upload
164-
uses: github/codeql-action/upload-sarif@v4
178+
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4
165179
with:
166180
sarif_file: clippy-results.sarif
167181
wait-for-processing: true
@@ -172,17 +186,19 @@ jobs:
172186
runs-on: ubuntu-latest
173187
steps:
174188
- name: Checkout repository
175-
uses: actions/checkout@v6
189+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
190+
with:
191+
persist-credentials: false
176192
- name: Install Rust
177-
uses: dtolnay/rust-toolchain@stable
193+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
178194
with:
179195
toolchain: stable
180-
- uses: Swatinem/rust-cache@v2
196+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
181197
- name: Install cargo-tarpaulin
182198
run: cargo install cargo-tarpaulin
183199
- name: Gather coverage
184200
run: cargo tarpaulin --output-dir coverage --out lcov
185201
- name: Publish to Coveralls
186-
uses: coverallsapp/github-action@master
202+
uses: coverallsapp/github-action@09b709cf6a16e30b0808ba050c7a6e8a5ef13f8d # master
187203
with:
188204
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/committed.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout Actions Repository
24-
uses: actions/checkout@v6
24+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2525
with:
2626
fetch-depth: 0
27+
persist-credentials: false
2728
- name: Lint Commits
28-
uses: crate-ci/committed@master
29+
uses: crate-ci/committed@4cd58ed75e5f581ba45f42ef52e055cc001def37 # master

.github/workflows/pre-commit.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222
contents: read
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v6
26-
- uses: j178/prek-action@v1
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2726
with:
28-
prek-version: '0.2.27'
27+
persist-credentials: false
28+
- uses: j178/prek-action@0bb87d7f00b0c99306c8bcb8b8beba1eb581c037 # v1
29+
with:
30+
prek-version: '0.3.8'

.github/workflows/rust-next.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ jobs:
3333
CARGO_PROFILE_DEV_DEBUG: line-tables-only
3434
steps:
3535
- name: Checkout repository
36-
uses: actions/checkout@v6
36+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
37+
with:
38+
persist-credentials: false
3739
- name: Install Rust
38-
uses: dtolnay/rust-toolchain@stable
40+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3941
with:
4042
toolchain: ${{ matrix.rust }}
41-
- uses: Swatinem/rust-cache@v2
42-
- uses: taiki-e/install-action@cargo-hack
43+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
44+
- uses: taiki-e/install-action@4448ce47d533cbe63d6dfafa732cf574a34606b5 # cargo-hack
4345
- name: Build
4446
run: cargo test --workspace --no-run
4547
- name: Test
@@ -54,13 +56,15 @@ jobs:
5456
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: allow
5557
steps:
5658
- name: Checkout repository
57-
uses: actions/checkout@v6
59+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
60+
with:
61+
persist-credentials: false
5862
- name: Install Rust
59-
uses: dtolnay/rust-toolchain@stable
63+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
6064
with:
6165
toolchain: stable
62-
- uses: Swatinem/rust-cache@v2
63-
- uses: taiki-e/install-action@cargo-hack
66+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
67+
- uses: taiki-e/install-action@4448ce47d533cbe63d6dfafa732cf574a34606b5 # cargo-hack
6468
- name: Update dependencies
6569
run: cargo update
6670
- name: Build

.github/workflows/spelling.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout Actions Repository
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
24+
with:
25+
persist-credentials: false
2426
- name: Spell Check Repo
25-
uses: crate-ci/typos@master
27+
uses: crate-ci/typos@8f11c0dc0f31c780c45b3dd5b72ff4b48a350b75 # master

.github/workflows/template.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ jobs:
2828
runs-on: ubuntu-latest
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3232
with:
3333
fetch-depth: 0
34+
persist-credentials: false
3435
- name: Configure git
3536
run: |
36-
git config --global user.name '${{ github.actor }}'
37+
git config --global user.name '${GITHUB_ACTOR}'
3738
git config --global user.email '<>'
3839
- name: Fetch template
3940
run: "git remote add template ${{ env.TEMPLATE_URL }} && git fetch template ${{ env.TEMPLATE_BRANCH }}"

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rules:
2+
superfluous-actions:
3+
# https://github.com/zizmorcore/zizmor/issues/1817
4+
disable: true

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pre-release-replacements = [
118118
{file="CHANGELOG.md", search="\\.\\.\\.HEAD", replace="...{{tag_name}}", exactly=1},
119119
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
120120
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
121-
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/rust-cli/roff-rs/compare/{{tag_name}}...HEAD", exactly=1},
121+
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: {{repository}}/compare/{{tag_name}}...HEAD", exactly=1},
122122
]
123123

124124
[dependencies]

0 commit comments

Comments
 (0)