fix(ci): create the GitHub Release via API action, not the runner's gh CLI#288
Open
ywatanabe1989 wants to merge 1 commit into
Open
fix(ci): create the GitHub Release via API action, not the runner's gh CLI#288ywatanabe1989 wants to merge 1 commit into
ywatanabe1989 wants to merge 1 commit into
Conversation
…h CLI gh aborts on the self-hosted runner's corrupt machine-local ~/.config/gh/config.yml before it ever reads GH_TOKEN, so no token could fix it. Use the API-based JS action with the built-in per-run github.token instead. No PAT involved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
The
releasejob fails at Create GitHub Release on the self-hosted Spartanrunner.
publishhas already succeeded by then, so PyPI ships but the GitHubRelease page is never created.
Root cause (this is NOT a token problem)
From the live failure log:
The self-hosted runner executes as the operator's account, so
$HOMEis/home/ywatanabeandghpicks up that account's machine-local config.That config is currently corrupt, and
ghaborts while parsing it — duringconfig-load, before it ever reads
GH_TOKEN.This matters, because the natural assumption is "the token expired, mint a PAT."
It is worth being precise:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}— the built-in, per-run token Actions injects automatically).
ghnever got far enough to use it. No token — built-in or PAT — couldhave fixed this, because the failure precedes authentication entirely.
So the bug is the dependency on the runner's
ghCLI and its machine-localstate, not on any credential.
Fix
Drop the
ghdependency for this step.softprops/action-gh-release@v2is a JSaction that calls the GitHub Releases API directly using the built-in per-run
${{ github.token }}. It reads no machine-local config, so runner state cannotbreak it. The job already grants the
permissions: contents: writeit needs, sothat is unchanged.
No secret is created, requested, or stored by this PR.
Same fix already merged in scitex-ui#68 and applied in scitex-writer /
scitex-todo / scitex-dev / scitex-agent-container (
ci-gh-selfhosted-release-guard);this completes the batch.
Related
scitex-math#5fixes the same class of bug from the other direction — theshared
$HOMEon the Spartan runner leaking the operator's~/.gitconfigintoCI — by redirecting the config to a per-job temp path. The general lesson: on
these runners, anything that reads
$HOMEdotfiles is a latent CI failure.Also in this PR: the same bug in
sync-mainsync-main("Open develop→main PR if diverged") runs on the same self-hostedrunner and shells out to
gh pr list/create/merge, so it dies for the identicalreason — and it failed in the same run. Those are genuine
ghoperations withno drop-in JS-action equivalent, so instead of removing
ghthis points it at aper-job config directory (
GH_CONFIG_DIR: ${{ runner.temp }}/gh).ghthenstarts from a clean config and authenticates from the built-in
GH_TOKENit isalready given. This mirrors the
GIT_CONFIG_GLOBALisolation in scitex-math#5.Again: no PAT.