Fix checkout-free publish repository context#1796
Merged
Merged
Conversation
Set GH_REPO at both privileged publish job boundaries so gh release commands do not depend on a checkout or local git remote. Add workflow regression assertions to keep the explicit repository context required for every checkout-free release operation.
Contributor
📝 WalkthroughWalkthroughBoth publish workflows now define ChangesPublish repository context
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
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.
Summary
Fix checkout-free native and dispatcher publish jobs so every
gh releaseoperation has explicit repository context.Root cause and fix
The PR-1 publish boundary intentionally has no repository checkout.
gh release view/create/upload/editnevertheless attempted to infer the repository from a local git remote, producingfatal: not a git repositoryduring the first real release. The publish jobs now setGH_REPO: ${{ github.repository }}at job scope, and both workflow tests assert that this context remains present.Security and residual risk
The change does not add checkout, repository-script execution, or broader token permissions. It only makes the target repository explicit for the already-approved privileged release operations. Release metadata, target SHA, tag, manifest, attestation, and environment protections remain unchanged. A malformed or unavailable GitHub context still fails the
ghoperation closed.Verification
scripts/test-native-cli-publish-workflow.shscripts/test-dispatcher-publish-workflow.shgo run ./cmd/check-release-triggers --base origin/v3-beta --head HEADgit diff --checkRecovery sequence (owner approval required; not executed by this PR)
After this fix is merged into
v3-beta, confirm the merge commit is the workflow head and that no target tag or release was created by the failed runs. Then, after owner approval, dispatch each workflow fromv3-betawithdry-run=false:Before allowing publish, inspect each run's resolver output: the native target must be
uloop-project-runner-v3.0.0-beta.48and the dispatcher target must bedispatcher-v3.1.0-beta.13, with each resolved target SHA equal to that run'sgithub.sha. Confirm the approved-commit guard passes on the post-merge fix head, then monitor draft creation, asset upload, attestation verification, and final publish. Do not release the Unity package until the runner release and pin-advance ordering requirements are satisfied.