Fix publish-release trigger and push auth - #2700
Merged
Merged
Conversation
The workflow gate was: if: startsWith(github.event.head_commit.message, 'release ') But when a release PR is merged via the GitHub UI (as was done for #2697 → main), the merge commit message is: Merge pull request #2697 from ViewComponent/release-4-14-0 Release 4.14.0 That does not start with 'release ' (lowercase), so the workflow never ran and script/publish did not tag or publish 4.14.0. Also, the checkout used persist-credentials: false, so even if the gate had passed, script/publish's 'git push origin $tag' and 'git push origin gh-pages --force' would fail to authenticate — the same class of bug we hit in the release workflow. - Broaden the gate to also match the merge-commit body ('Release ') and add workflow_dispatch so publish can be re-triggered manually when a release lands but the gate was missed. - Set persist-credentials: true so tag and gh-pages pushes work. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
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.
Follow-up. After #2697 (Release 4.14.0) merged to main,
.github/workflows/publish-release.ymldid not run, so 4.14.0 was never tagged, gh-pages was not updated, and no GitHub Release was created.Root cause
The workflow gate was:
But the merge commit created by GitHub's PR merge is:
That starts with
Merge pull request…(and the PR title'sReleaseis capitalized), so the gate never matched. It would only match if someone pushed a rawrelease X.Y.Zcommit directly to main — which is not how the release flow works today.Additionally, the checkout used
persist-credentials: false, soscript/publish'sgit push origin $tagandgit push origin gh-pages --forcewould fail to authenticate — same class of bug as the release workflow.Fix
Release, so a normal PR merge triggers publish.workflow_dispatch:so publish can be re-triggered manually when a release lands but was missed (needed right now to publish 4.14.0).persist-credentials: trueso tag and gh-pages pushes authenticate.Recovery for 4.14.0
Once this merges, go to Actions → Publish Release → Run workflow on
mainto tagv4.14.0, push gh-pages, and create the GitHub Release.script/publishis already idempotent for the tag creation (git rev-parse --quiet --verifycheck +|| trueon the tag push), so a re-run is safe.