From c5ab25da72b99eb1a90c755df15dea798be08026 Mon Sep 17 00:00:00 2001 From: Taylor Buchanan Date: Fri, 14 Aug 2026 15:20:05 -0500 Subject: [PATCH] Preset MISE_GITHUB_TOKEN in the mise-setup action 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) --- .changeset/olive-donkeys-repeat.md | 4 ++++ .github/actions/mise-setup/action.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .changeset/olive-donkeys-repeat.md diff --git a/.changeset/olive-donkeys-repeat.md b/.changeset/olive-donkeys-repeat.md new file mode 100644 index 00000000..5a9afd07 --- /dev/null +++ b/.changeset/olive-donkeys-repeat.md @@ -0,0 +1,4 @@ +--- +--- + +Preset MISE_GITHUB_TOKEN in the mise-setup action diff --git a/.github/actions/mise-setup/action.yml b/.github/actions/mise-setup/action.yml index 5383e54e..b4888026 100644 --- a/.github/actions/mise-setup/action.yml +++ b/.github/actions/mise-setup/action.yml @@ -13,12 +13,24 @@ runs: # (analogous to pnpm `--frozen-lockfile`). jdx/mise-action already # sets MISE_YES + MISE_TRUSTED_CONFIG_PATHS, so trust prompts and # interactive confirmations are handled by the action itself. + # + # MISE_GITHUB_TOKEN is set here rather than left to mise-action's + # own github_token input (which already defaults to github.token). + # The action exports that variable only *after* it has run + # `mise self-update`, so when a restored cache holds a different + # mise version than the pinned one below, self-update queries the + # GitHub releases API unauthenticated and 403s under rate limiting. + # Presetting wins because the action skips any variable already in + # the environment. See jdx/mise-action#292; drop this line once the + # action exports the token before it self-updates. - env: DATA_DIR: ${{ runner.temp }}/.mise + GH_TOKEN: ${{ github.token }} name: Configure mise environment run: | { echo "MISE_DATA_DIR=${DATA_DIR}" + echo "MISE_GITHUB_TOKEN=${GH_TOKEN}" echo "MISE_LOCKED=1" } >> "$GITHUB_ENV" shell: bash