Preset MISE_GITHUB_TOKEN in the mise-setup action - #406
Conversation
mise-action exports MISE_GITHUB_TOKEN only after it has already run `mise self-update`, so that subprocess queries the GitHub releases API unauthenticated. When a restored cache holds a mise version other than the pinned one, self-update runs and can fail with a 403 under rate limiting -- observed on the Codecov Upload job, which died in mise-setup before reaching any repo code. Export the token from the step that already writes MISE_DATA_DIR and MISE_LOCKED to $GITHUB_ENV. The action skips any variable already present in the environment, so presetting takes precedence and the value is in place before self-update runs. It is the same ambient github.token the action would have exported anyway, only earlier. Untested end to end: the path only triggers when the cache is a mise version behind, and the cache is now warm at the pinned version. Reported upstream as jdx/mise-action#292; drop this once the action exports the token before it self-updates. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📜 Recent review details🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-06-17T04:54:26.509ZApplied to files:
🪛 markdownlint-cli2 (0.23.2).changeset/olive-donkeys-repeat.md[warning] 4-4: First line in a file should be a top-level heading (MD041, first-line-heading, first-line-h1) 🔇 Additional comments (3)
📝 WalkthroughWalkthroughThe Changesmise GitHub token setup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized CI change presets the existing GitHub token before mise initialization to prevent an unauthenticated self-update; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Workaround for a CI failure hit on #404: the
Codecov Uploadjob died insidemise-setup, before reaching any repo code.Cause
mise-actionexportsMISE_GITHUB_TOKENonly after it has already runmise self-update, and the exec inherits the environment without an override. So that one subprocess queries the GitHub releases API unauthenticated and 403s under rate limiting. Supplying the action'sgithub_tokeninput doesn't help — it already defaults togithub.token; the problem is when the variable reaches the environment, not whether it's set. There's no ambient fallback either, since the action exportsMISE_GITHUB_TOKENrather thanGITHUB_TOKEN.Only self-update is affected — every later
mise installis authenticated — and only when a restored cache holds a mise version other than the pinned one, which is why it presents as intermittent.Change
Export the token from the step that already writes
MISE_DATA_DIRandMISE_LOCKEDto$GITHUB_ENV, so it's in place beforemise-actionruns. The action skips any variable already present in the environment, so presetting takes precedence.It's the same ambient
github.tokenthe action would have exported anyway, just earlier — no new exposure. The value goes through anenv:binding rather than inline interpolation, matching howDATA_DIRis handled.Caveat
Not verified end to end. The failure path only triggers when the cache is a mise version behind the pin, and the cache is now warm at the pinned version — so CI here will very likely pass without ever entering the self-update path. The reasoning rests on reading the action source plus the failing log, not on observing a fixed run. It should stop the failure from recurring after the next mise bump.
Reported upstream as jdx/mise-action#292 (existing open issue covering the same 403; I added the cause analysis). The comment in the action carries the removal trigger.
🤖 Generated with Claude Code