Repository navigation
feat(update-release-changelog): skip the update when the release tag exists - #351
Merged
Merged
Conversation
…exists The update-release-changelog action runs on every push to a release branch. Once the release is tagged it has shipped, and auto-changelog rejects the update with "Current version already has a tag", so any later push failed the run. Those pushes are housekeeping, not new changes: the merge of the changelog PR itself, or a merge of `stable` into the branch. Add a `skip-if-tag-exists` input, defaulting to `true`. A new first step derives `v<version>` from a `release/X.Y.Z` or `release/X.Y.Z-ota` branch name (the pattern the updater itself accepts) and checks for that tag with one GitHub API call. If the tag exists, the remaining steps are skipped and the run finishes successfully, with a notice and a job summary that report how many commits sit on the branch after the tag. Set `skip-if-tag-exists: 'false'` to keep the previous behaviour. The skip applies whenever the tag exists, including for a release that is not the most recent one, which auto-changelog did not reject. The check runs before the full-history checkout, so a skipped run does not pay for it. It fails open: a branch name it cannot parse, or any API error other than a 404, logs a warning and runs the update as before. The branch name goes through `env:` and a strict regex, never into the shell directly, text echoed into workflow commands has newlines stripped, and the step blanks AI_ANALYZER_LITELLM_KEY like the other steps that do not need it. Refs: INFRA-3151 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Refs: INFRA-3151 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The default-on skip affects every @v1 caller, but tagged, untagged, and explicit opt-out runs still need validation in GitHub Actions before moving v1.
No open issues 🎉
What changed in this PR
Updates update-release-changelog to skip changelog processing when the release tag already exists, avoiding failures on housekeeping pushes to tagged release branches.
Changes:
- Adds
skip-if-tag-exists, enabled by default, with an opt-out for previous behavior. - Checks for the tag before checkout, skips subsequent steps when found, and reports commits after the tag.
- Documents the behavior, including skipping older tagged releases and proceeding when the tag check fails.
| File | Description |
|---|---|
| CHANGELOG.md | Documents the new input, skip behavior, reporting, and fallback. |
| .github/actions/update-release-changelog/action.yml | Adds the tag check, skip reporting, and conditions on subsequent steps. |
Review effort: Balanced
alexhungnguyen
approved these changes
Dec 1, 2026
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
Fixes INFRA-3151: the
update-release-changelogaction failed on pushes to a release branch after its tag was created.The metamask-mobile and metamask-extension workflows run this action on every push to
release/*. Once a release is tagged,auto-changelogrejects the update withCurrent version already has a tag ('vX.Y.Z'), which is unexpected for a release candidate, and the run fails. The pushes that trigger it are housekeeping, not new changes: the merge of the changelog PR itself, or a merge ofstableinto the branch. Confirmed in real metamask-mobile runs onrelease/8.20.1-ota,release/8.20.2-otaandrelease/8.21.1-ota(Nov 2026).Changes
skip-if-tag-exists, default'true'. Set it to'false'to keep the previous behaviour.tag-check, before the full-history checkout. It derivesv<version>from arelease/X.Y.Zorrelease/X.Y.Z-otabranch name (the pattern the updater accepts), then makes onegh api repos/<repo>/git/ref/tags/<tag>call (exact-ref match).Behaviour change to be aware of
@v1oncev1moves. Public code search found only the mobile and extension workflows.auto-changelogonly rejected the most recent tag, so pushes to an older tagged release branch are now skipped as well.Security
env:and a strict regex, never${{ }}inrun:. The tag is built only from validated digits.GH_TOKENis the token the caller already passes to the action. A GET on a git ref needscontents: read.AI_ANALYZER_LITELLM_KEY, like the other steps that do not need it.Testing
-ota, extension), a missing tag, an older tagged release, unparseable names, a newline-injection name, and a bad token (401).yarn lint:misc --check,yarn lint:changelogandgit diff --checkpass.v1, point one caller or a scratch workflow at this branch's commit and run three cases: tag exists, tag missing, andskip-if-tag-exists: 'false'.Critical review
Verdict: OK TO PROCEED (no CRITICAL or HIGH findings). Findings and how they were handled:
Version-vX.Y.Zform in the regex is dead, and the regex is looser than the updater.^release/X.Y.Z(-ota)?$, as the updater does.🤖 Generated with Claude Code