Skip to content

Commit ab97329

Browse files
authored
chore: use mise for repository tooling (#13)
* chore: use mise for repository tooling * chore: pin bun in mise.toml (no command uses it yet) * fix(ci): pin the mise binary, require a mise that reads the lock, restore the npm cache * fix(ci): the mise-action checksum is that of the extracted binary * docs: say what bun is pinned for and that the mise pin is bumped by hand
1 parent 430c6c8 commit ab97329

6 files changed

Lines changed: 207 additions & 53 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# RunsOn label convention for heavy jobs that arrive with the code (not used
22
# yet: every job below is a tiny gate job on ubuntu-latest):
33
# runs-on: runs-on=${{ github.run_id }}-${{ github.run_attempt }}-<job>/runner=4cpu-linux-x64
4+
# The mise binary is pinned below (version and the sha256 of the extracted binary). Bump both by hand
5+
# together, and keep min_version in mise.toml at or below it; Renovate updates the tools in mise.toml and mise.lock.
46
name: CI
57

68
on:
@@ -28,19 +30,15 @@ jobs:
2830
with:
2931
fetch-depth: 0
3032
persist-credentials: false
31-
- name: Install gitleaks
32-
env:
33-
# renovate: datasource=github-releases depName=gitleaks/gitleaks
34-
GITLEAKS_VERSION: 8.30.1
35-
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
36-
run: |
37-
curl -fsSLo gitleaks.tar.gz "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz"
38-
echo "${GITLEAKS_SHA256} gitleaks.tar.gz" | sha256sum -c -
39-
tar -xzf gitleaks.tar.gz gitleaks && rm gitleaks.tar.gz
33+
- uses: jdx/mise-action@236a21c3b91f5db6d4e174b348674a0f0caac06d # v5.2.9
34+
with:
35+
version: 2026.11.9
36+
sha256: f13f3e5ec88807e0161669b3aa07a91d84478cdf1e95b5b92b63f85a25d42395
37+
install_args: gitleaks
4038
- name: Scan commits
41-
run: ./gitleaks git --config .gitleaks.toml --redact --verbose .
39+
run: gitleaks git --config .gitleaks.toml --redact --verbose .
4240
- name: Scan tree
43-
run: ./gitleaks dir --config .gitleaks.toml --redact --verbose .
41+
run: gitleaks dir --config .gitleaks.toml --redact --verbose .
4442

4543
workflow-policy:
4644
name: Workflow Policy
@@ -50,25 +48,17 @@ jobs:
5048
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
5149
with:
5250
persist-credentials: false
51+
- uses: jdx/mise-action@236a21c3b91f5db6d4e174b348674a0f0caac06d # v5.2.9
52+
with:
53+
version: 2026.11.9
54+
sha256: f13f3e5ec88807e0161669b3aa07a91d84478cdf1e95b5b92b63f85a25d42395
55+
install_args: actionlint zizmor
5356
- name: Run actionlint
54-
env:
55-
# renovate: datasource=github-releases depName=rhysd/actionlint
56-
ACTIONLINT_VERSION: 1.7.12
57-
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8
58-
run: |
59-
curl -fsSLo actionlint.tar.gz "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
60-
echo "${ACTIONLINT_SHA256} actionlint.tar.gz" | sha256sum -c -
61-
tar -xzf actionlint.tar.gz actionlint && rm actionlint.tar.gz
62-
./actionlint
57+
run: actionlint
6358
- name: Run zizmor
64-
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
6559
env:
66-
# renovate: datasource=github-releases depName=zizmorcore/zizmor
67-
ZIZMOR_VERSION: 1.30.1
68-
with:
69-
advanced-security: false
70-
annotations: true
71-
version: ${{ env.ZIZMOR_VERSION }}
60+
GH_TOKEN: ${{ github.token }}
61+
run: zizmor --format=github .
7262

7363
changes:
7464
name: Changes
@@ -100,10 +90,16 @@ jobs:
10090
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
10191
with:
10292
persist-credentials: false
103-
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
93+
- uses: jdx/mise-action@236a21c3b91f5db6d4e174b348674a0f0caac06d # v5.2.9
10494
with:
105-
node-version-file: .nvmrc
106-
cache: npm
95+
version: 2026.11.9
96+
sha256: f13f3e5ec88807e0161669b3aa07a91d84478cdf1e95b5b92b63f85a25d42395
97+
install_args: node
98+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
99+
with:
100+
path: ~/.npm
101+
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
102+
restore-keys: npm-${{ runner.os }}-
107103
- run: npm ci --ignore-scripts
108104
- run: npm run lint
109105
- run: npm run typecheck
@@ -119,10 +115,16 @@ jobs:
119115
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
120116
with:
121117
persist-credentials: false
122-
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
118+
- uses: jdx/mise-action@236a21c3b91f5db6d4e174b348674a0f0caac06d # v5.2.9
119+
with:
120+
version: 2026.11.9
121+
sha256: f13f3e5ec88807e0161669b3aa07a91d84478cdf1e95b5b92b63f85a25d42395
122+
install_args: node
123+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
123124
with:
124-
node-version-file: .nvmrc
125-
cache: npm
125+
path: ~/.npm
126+
key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
127+
restore-keys: npm-${{ runner.os }}-
126128
- run: npm ci --ignore-scripts
127129
- name: Fresh-runner preflight (IPv6 loopback)
128130
run: |

‎.nvmrc‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎CONTRIBUTING.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ Grimoire is developed in the open, through small pull requests into `main`.
2121
recording of the new behaviour (and a diagram or terminal capture where it
2222
helps), and a bug-fix pull request includes before and after shots. If a
2323
visual makes no sense, say "not applicable" in the description and why.
24+
Attach files with the GitHub CLI: for a feature, `gh pr create --attach './login.png#The new login page'`;
25+
for a bug fix, `gh pr edit 12 --attach ./before.png --attach ./after.png`.
2426
- Never commit secrets or credentials.
2527
- Contributions are accepted under the same licence as the project, the
2628
Apache License 2.0 (inbound equals outbound); there is no contributor
2729
agreement.
2830

31+
## Set-up
32+
33+
Install [mise](https://mise.jdx.dev) and run `mise install`: `mise.toml` and `mise.lock` pin Node and the checking tools (gitleaks, actionlint, zizmor) for local work and for CI. Then run `npm ci`.
34+
2935
To report a security issue, do not open a public issue: follow
3036
[SECURITY.md](SECURITY.md).
3137

‎mise.lock‎

Lines changed: 152 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎mise.toml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
# The single source of tool versions for local work and CI (`mise install`). mise.lock pins the exact
2+
# downloads with their checksums; Renovate keeps both current.
3+
min_version = "2026.11.9" # the lockfile format (version 4) needs this release or newer
4+
15
[tools]
26
node = "26"
7+
bun = "1.4.4" # pinned ahead of the move from npm to bun; no command runs it yet
8+
gitleaks = "8.30.1"
9+
actionlint = "1.7.12"
10+
zizmor = "1.30.1"
11+
12+
[settings]
13+
lockfile = true

‎renovate.json‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,30 +34,14 @@
3434
"major"
3535
],
3636
"automerge": false
37-
},
38-
{
39-
"description": "Pinned tool binaries carry a sha256 that must be bumped by hand in the same PR",
40-
"matchDepNames": [
41-
"gitleaks/gitleaks",
42-
"rhysd/actionlint"
43-
],
44-
"automerge": false
4537
}
4638
],
4739
"minimumReleaseAge": "3 days",
4840
"internalChecksFilter": "strict",
49-
"customManagers": [
50-
{
51-
"customType": "regex",
52-
"description": "Version pins in workflow step env vars, e.g. the gitleaks binary (sha256 must be bumped in the same PR; the checksum step fails otherwise)",
53-
"managerFilePatterns": ["/^\\.github/workflows/.+\\.ya?ml$/"],
54-
"matchStrings": [
55-
"# renovate: datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)\\s+\\w+_VERSION: (?<currentValue>\\S+)"
56-
],
57-
"extractVersionTemplate": "^v?(?<version>.*)$"
58-
}
59-
],
6041
"github-actions": {
6142
"pinDigests": true
43+
},
44+
"mise": {
45+
"enabled": true
6246
}
6347
}

0 commit comments

Comments
 (0)