Skip to content

ci: open a changelog PR instead of pushing to main - #113

Merged
KevinEdry merged 1 commit into
mainfrom
ci/changelog-push-nonfatal
Jun 18, 2026
Merged

KevinEdry merged 1 commit into
mainfrom
ci/changelog-push-nonfatal

Conversation

@KevinEdry

@KevinEdry KevinEdry commented Jun 18, 2026 •

Copy link
Copy Markdown
Owner

Problem

The release workflow succeeds at the important steps — publish to npm and create the GitHub Release — but then tries to commit the regenerated CHANGELOG.md directly to main. main's branch ruleset declines that push:

remote: error: GH013: Repository rule violations found for refs/heads/main.
remote: - 2 of 2 required status checks are expected.
! [remote rejected] main -> main (push declined due to repository rule violations)

So otherwise-successful releases (v2.10.0, v2.11.0) get marked failed on the very last step, after the package is already live.

Fix

Instead of pushing to main, open a PR with the changelog change using peter-evans/create-pull-request (branch changelog/v<version>, scoped to CHANGELOG.md). This respects the ruleset, keeps the release job green, and still lands the changelog on main once the PR's checks pass and it's merged.

Also adds pull-requests: write to the publish job permissions.

⚠️ One-time repo setting required

For the workflow's GITHUB_TOKEN to open PRs, enable:

Settings → Actions → General → Workflow permissions → "Allow GitHub Actions to create and approve pull requests"

Without it, the step will fail with a 403.

@vercel

vercel Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestjs-trpc-docs Ready Ready Preview, Comment Jun 18, 2026 6:45pm

Request Review

The release workflow publishes to npm and creates the GitHub Release, then
tried to commit the regenerated CHANGELOG.md directly to main. main's branch
ruleset (required status checks) declines that push with GH013, which marked
otherwise-successful releases as failed (e.g. v2.10.0, v2.11.0).

Instead, open a PR against main with the changelog change via
peter-evans/create-pull-request. This respects the ruleset, keeps the
release job green, and still lands the changelog on main once merged.

Requires the repo setting "Allow GitHub Actions to create and approve pull
requests" (Settings -> Actions -> General) to be enabled.
@KevinEdry
KevinEdry force-pushed the ci/changelog-push-nonfatal branch from 4fba7a8 to 77b3d8c Compare June 18, 2026 18:44
@KevinEdry KevinEdry changed the title ci: don't fail release when changelog push to main is blocked by ruleset ci: open a changelog PR instead of pushing to main Jun 18, 2026
@KevinEdry
KevinEdry merged commit 8201d20 into main Jun 18, 2026
5 checks passed
@KevinEdry
KevinEdry deleted the ci/changelog-push-nonfatal branch June 18, 2026 18:57

This branch was successfully deployed

1 active deployment
Preview — 77b3d8c2 Deployed Jun 18, 2026 by vercel[bot]
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.

1 participant