Skip to content

Commit d6e0971

Browse files
albertodonatoclaude
andcommitted
feat: add mise-config-file option to run-script
### what add a `mise-config-file` parameter to the `run-script` workflow to load an additional mise config file, which takes precedence over `mise.toml` ### 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 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent d5b3816 commit d6e0971

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 7 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-config-file:
22+
type: string
23+
description: "Name of an additional mise config file, taking precedence over mise.toml. A bare filename, looked up from the working directory up to the repository root"
24+
default: "mise.toml"
2125
secrets:
2226
STEP_SECURITY_API_KEY:
2327
required: false
@@ -29,6 +33,7 @@ jobs:
2933
contents: read
3034
env:
3135
HARDEN_RUNNER: ${{ secrets.STEP_SECURITY_API_KEY != '' }} # zizmor: ignore[secrets-outside-env]
36+
MISE_DEFAULT_CONFIG_FILENAME: ${{ inputs.mise-config-file }}
3237
steps:
3338
- name: Harden Runner
3439
if: env.HARDEN_RUNNER == 'true'
@@ -48,6 +53,8 @@ jobs:
4853
with:
4954
minimum_release_age: 7d
5055
cache: true
56+
# The default cache key only hashes standard mise config names, so add the custom file.
57+
cache_key: "{{cache_key_prefix}}-{{platform}}-{{file_hash}}-${{ hashFiles(format('**/{0}', inputs.mise-config-file)) }}"
5158

5259
# Always read the cache, it's safe to do so even on untrusted PRs.
5360
- name: Restore pre-commit cache

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ 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 the standard mise config files (`mise.toml`, `.tool-versions`, ...).
38+
Set `mise-config-file` to load an additional config file, such as one with CI-only
39+
tools, which takes precedence over `mise.toml`. It must be a bare filename (not a
40+
path), which mise looks up from the working directory up to the repository root.
41+
3742

3843
```
3944
Lint:

0 commit comments

Comments
 (0)