Skip to content

Fix CD release: use new commit instead of force-push to update master#719

Merged
CasperWA merged 3 commits into
masterfrom
cwa/fix-deployment
Apr 21, 2026
Merged

Fix CD release: use new commit instead of force-push to update master#719
CasperWA merged 3 commits into
masterfrom
cwa/fix-deployment

Conversation

@CasperWA

@CasperWA CasperWA commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The cd_release.yml workflow has been failing on every push to master since ~December 2025.

Root cause: The workflow amends the last commit (version bump + CHANGELOG) and then uses push-protected with force: true. Master's branch protection now has allow_force_pushes: false, so every force-push is rejected with GH006/GH013. The push-protected@v2 action's unprotect_reviews only removes required_pull_request_reviews — it does not touch allow_force_pushes.

Fix: Replace git commit --amend -C HEAD with a plain git commit, so the local branch is simply one commit ahead of origin/master (fast-forward). Set force: false in the push-protected step. Also update the deprecated sleep input to pre_sleep, enable unprotect_reviews: true to temporarily lift the PR-review requirement during the push, and add [skip ci] to the commit message so it does not trigger redundant workflow runs.

Trade-offs

  • Two commits per version bump instead of one. Previously the PR merge commit was amended in-place; now a separate [bot] Update version and CHANGELOG [skip ci] commit follows it. The [skip ci] token prevents any workflows from being triggered by that push, so there is no extra CI or CD run.

Verification

Watch the next push to master — the CD - Release workflow should pass its Update 'master' step and create the [bot] Update version and CHANGELOG [skip ci] commit on master.

Click to view squash commit message

Fix cd_release.yml: use a new commit and non-force push

Branch protection on master has allow_force_pushes: false. The workflow
was amending the last commit then force-pushing via push-protected,
causing all CD runs to fail since ~December 2025.

Fix by creating a plain new commit (fast-forward) and setting force: false
in push-protected. Also update the deprecated sleep input to pre_sleep
and enable unprotect_reviews: true to temporarily lift the PR-review
requirement during the push. Add [skip ci] to the bot commit message so
the version-bump commit does not trigger redundant workflow runs.

@codecov

codecov Bot commented Apr 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.34%. Comparing base (eae0c43) to head (f27f18e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #719   +/-   ##
=======================================
  Coverage   84.34%   84.34%           
=======================================
  Files          26       26           
  Lines         805      805           
=======================================
  Hits          679      679           
  Misses        126      126           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Updates the CD release workflow so it can update master under stricter branch protection rules (no force-pushes), while still committing the version bump + changelog changes back to the default branch.

Changes:

  • Switch version/changelog update from git commit --amend to creating a new commit.
  • Update CasperWA/push-protected@v2 usage to force: false, replace sleep with pre_sleep, and enable unprotect_reviews.
  • Ignore the .claude/ directory in .gitignore.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
.gitignore Ignores .claude/ artifacts.
.github/workflows/cd_release.yml Avoids force-push by creating a new commit and pushing without force, updating push-protected inputs accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/cd_release.yml

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

Fixes the CD - Release GitHub Actions workflow so it can update the protected master branch without force-pushing, addressing the current branch-protection rejection.

Changes:

  • Replace git commit --amend with a new commit for version/CHANGELOG updates (fast-forward push).
  • Update push-protected@v2 inputs: switch sleeppre_sleep, set force: false, and enable unprotect_reviews.
  • Ignore local .claude/ directory via .gitignore.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/cd_release.yml Stops force-pushing by creating a new commit and uses non-force push-protected settings compatible with branch protection.
.gitignore Adds .claude/ to ignored local/tooling artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/cd_release.yml Outdated

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

Updates the CD release workflow to comply with master branch protection by avoiding force-push/amend and instead pushing a new fast-forward commit for version/CHANGELOG updates.

Changes:

  • Switch version/CHANGELOG update from git commit --amend to a new commit with [skip ci].
  • Update CasperWA/push-protected@v2 inputs to use pre_sleep, disable force, and enable unprotect_reviews.
  • Ignore local .claude/ directory in .gitignore.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
.github/workflows/cd_release.yml Removes amend/force-push behavior; pushes a new commit to master using non-force push-protected settings.
.gitignore Adds .claude/ to ignored paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CasperWA
CasperWA force-pushed the cwa/fix-deployment branch 3 times, most recently from a64addd to cfd7834 Compare April 21, 2026 11:02
@CasperWA
CasperWA force-pushed the cwa/fix-deployment branch from cfd7834 to f27f18e Compare April 21, 2026 11:07
@CasperWA
CasperWA merged commit 920172e into master Apr 21, 2026
16 checks passed
@CasperWA
CasperWA deleted the cwa/fix-deployment branch April 21, 2026 11:14
CasperWA added a commit that referenced this pull request Apr 21, 2026
…#719)

Fix cd_release.yml: use a new commit and non-force push

Branch protection on master has allow_force_pushes: false. The workflow
was amending the last commit then force-pushing via push-protected,
causing all CD runs to fail since ~December 2025.

Fix by creating a plain new commit (fast-forward) and setting force: false
in push-protected. Also update the deprecated sleep input to pre_sleep
and enable unprotect_reviews: true to temporarily lift the PR-review
requirement during the push. Add note to avoid cito the bot commit message
so the version-bump commit does not trigger redundant workflow runs.
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.

2 participants