Closed donaldguy closed 1 month ago
There definitely might be some virtue (separate from the current only-used-for-jq state) in displaying .tool-versions
compatibility in this repo
(both as a type of "living documentation" and in principle making mise
not, as a matter of requirement, self-hosting)
but if so that would probably be best handled by a GitHub action to the effect of [i.e. I wrote but didn't test in any way]
name: update-tool-versions
on:
pull_request_target:
types:
- opened
- edited
- synchronize
paths:
- ".mise.toml"
permissions:
contents: read
pull-requests: write
jobs:
check-if-tools-changed:
runs-on: ubuntu-22.04
steps:
# for speed I'd think you'd want (both here and by the by e.g.
# at github.com/jdx/mise/blob/23db39/.github/workflows/test-plugins.yml#L22-L38 in many cases)
- uses: jdx/mise-action@v2
with: { install: false }
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN || github.token }}
- run: "mise current > .tool-versions"
- run: "git diff --quiet -- .tool-versions"
- if: ${{ failure() }}
uses: parkerbxyz/suggest-changes@v1
with:
comment: "Please keep .tool-versions in sync with .mise.toml as follows"
or a more aggressive version if you are inclined to give the job contents: write
(and/or silently handle it at merge time)
As to the above, mise current
currently:
npm:
and cargo:
lines that I'm not sure if asdf, etc. supports (though I think it would just ignore/warn about them as not-installed plugins)| sort > .tool-versions
)
Pretty self-explanatory.
After an initial clone, I thought it was odd that I got:
so I removed the (main) outlier [it also seems odd and possibly like a bug that globals are included in a
--current
output (because this is a child of my home directory?) but that's for another issue or PR]