ci: fix changelog auto-update workflow for concurrent stacked PR runs - #46
Merged
Conversation
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job for Changelog CI
ci: handle non-fast-forward push races in changelog workflow
Aug 6, 2026
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
…ch step Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Changelog CI GitHub Actions workflow to reduce failures caused by concurrent runs pushing to the same docs/update-changelog branch, and adds a manual workflow_dispatch path to run the changelog update for a specified merged PR.
Changes:
- Added
workflow_dispatchsupport with an input PR number and a new “Resolve PR data” step to fetch PR details when manually triggered. - Routed the resolved PR object into the exclusion check and changelog update steps, instead of relying directly on
context.payload.pull_request. - Hardened the “Commit and push changes” logic with strict shell mode, a no-op guard, pre-push fetch/rebase, and a single retry on push rejection; also switched existing-branch sync to a hard reset to the remote tip.
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
Co-authored-by: yCodeTech <31927084+yCodeTech@users.noreply.github.com>
yCodeTech
approved these changes
Aug 7, 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.
This pull request improves the
changelog-ciGitHub Actions workflow by adding support for stacked PRs that get merged and run the workflow simultaneously, which prevents future concurrent runs from failing caused by push rejections because of a second run committing locally after the first had already pushed.This PR also introduces a manual way of running a previously failed changelog update via workflow dispatch with an input for the merged PR number to be able to obtain the PR data.
The main changes are grouped below:
Workflow Dispatch & PR Data Handling:
Added a
workflow_dispatchtrigger with an input forpr_number, allowing maintainers to manually add merged PRs to the changelog if the CI failed. This allows the workflow to be fixed, and re-run for the merged PR that failed on the latest changes so it can have another chance at updating the changelog. This is required because GitHub's own "re-run failed jobs" button doesn't re-run failed workflows on the latest commit, so fixes won't propagate, and will most likely keep failing.Added a new "Resolve PR data" step to fetch PR data via the GitHub API using the
pr_numberinput when triggered manually, validate the PR data, and to pass this data between steps in a consistent, encoded format. If the workflow wasn't triggered manually, then it gets the PR data from the workflow context.Updated all script steps that require PR data to use the resolved PR object, ensuring accurate and consistent data usage throughout the workflow.
Branch and Push Robustness:
Standardised the changelog base branch to
masterusing an environment variable, ensuring consistent branch targeting for changelog updates. This prevents stacked PRs from using the base branch of the previous PR in the stack as the base branch of the changelog PR.Improved branch checkout and update logic to use safer shell practices and to reset local branches to match remote, reducing merge conflicts and errors.
Enhanced the commit and push process to handle empty commits gracefully and to recover from push races by rebasing and retrying, improving reliability in concurrent update scenarios.
These changes make the changelog automation workflow more flexible, maintainable, and robust.