Skip to content

ci: fix changelog auto-update workflow for concurrent stacked PR runs - #46

Merged
yCodeTech merged 11 commits into
masterfrom
copilot/ycodetech-fix-github-actions-job
Aug 7, 2026
Merged

ci: fix changelog auto-update workflow for concurrent stacked PR runs#46
yCodeTech merged 11 commits into
masterfrom
copilot/ycodetech-fix-github-actions-job

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

This pull request improves the changelog-ci GitHub 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_dispatch trigger with an input for pr_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_number input 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 master using 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.

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
Copilot AI requested a review from yCodeTech August 6, 2026 02:40
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>
@yCodeTech
yCodeTech marked this pull request as ready for review August 7, 2026 00:49
Copilot AI lite review requested due to automatic review settings August 7, 2026 00:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dispatch support 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.

Comment thread .github/workflows/changelog-ci.yml
Comment thread .github/workflows/changelog-ci.yml Outdated
Comment thread .github/workflows/changelog-ci.yml
Comment thread .github/workflows/changelog-ci.yml Outdated
Comment thread .github/workflows/changelog-ci.yml
Comment thread .github/workflows/changelog-ci.yml Outdated
Copilot AI and others added 5 commits August 7, 2026 01:23
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 yCodeTech changed the title ci: handle non-fast-forward push races in changelog workflow ci: fix changelog auto-update workflow for concurrent stacked PR runs Aug 7, 2026
@yCodeTech
yCodeTech merged commit 61df57c into master Aug 7, 2026
@yCodeTech
yCodeTech deleted the copilot/ycodetech-fix-github-actions-job branch August 7, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants