Skip to content

Commit 48cc95e

Browse files
feat: add mise-env option to run-script (#6)
### what add a `mise-env` parameter to the `run-script` workflow to set `MISE_ENV`, so that `mise.<env>.toml` config files are loaded on top of the default config. Also requires lockfile. ### why Allow using CI-specific tooling without having `mise` pick it up by default in the repo ### testing will test in workflows ### docs updated docs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d5b3816 commit 48cc95e

5 files changed

Lines changed: 92 additions & 3 deletions

File tree

‎.github/workflows/run-script.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
type: boolean
1919
description: "Expose the job's read-only GitHub token to the script as GH_TOKEN"
2020
default: false
21+
mise-env:
22+
type: string
23+
description: "Value for MISE_ENV, selecting additional mise.<env>.toml config files"
24+
default: ""
2125
secrets:
2226
STEP_SECURITY_API_KEY:
2327
required: false
@@ -29,6 +33,8 @@ jobs:
2933
contents: read
3034
env:
3135
HARDEN_RUNNER: ${{ secrets.STEP_SECURITY_API_KEY != '' }} # zizmor: ignore[secrets-outside-env]
36+
MISE_ENV: ${{ inputs.mise-env }}
37+
MISE_LOCKED: "1"
3238
steps:
3339
- name: Harden Runner
3440
if: env.HARDEN_RUNNER == 'true'

‎.tool-versions‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎README.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ commits never get one, so a SHA is what names the commit you meant.
3434

3535
Run a set of commands on the repository, with the required tools installed via `mise`.
3636

37+
Tools are read from `mise.toml`, and the `mise.lock` lockfile is required to be
38+
present and contain all the tools to install. `.tool-versions` is not supported
39+
due to lack of hash pinning.
40+
41+
Set `mise-env` to select a [mise
42+
environment](https://mise.jdx.dev/configuration/environments.html) via
43+
`MISE_ENV`, so that `mise.<env>.toml` files (such as one with CI-only tools)
44+
are loaded on top of the default config.
45+
3746

3847
```
3948
Lint:

‎mise.lock‎

Lines changed: 69 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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[tools]
2+
just = "1.58.0"
3+
prek = "0.5.5"
4+
uv = "0.13.4"
5+
6+
[settings]
7+
lockfile = true
8+
lockfile_platforms = ["linux-x64", "linux-arm64", "macos-x64", "macos-arm64"]

0 commit comments

Comments
 (0)