Skip to content

fix(ci): build changelog in regeneration PR, not via protected-branch push - #402

Merged
TKIPisalegacycipher merged 1 commit into
mainfrom
fix/changelog-in-regen-pr
Jun 10, 2026
Merged

fix(ci): build changelog in regeneration PR, not via protected-branch push#402
TKIPisalegacycipher merged 1 commit into
mainfrom
fix/changelog-in-regen-pr

Conversation

@TKIPisalegacycipher

Copy link
Copy Markdown
Collaborator

Root cause

Run 27302232244 failed in create-release.ymlBuild changelog:

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

The step rendered CHANGELOG.md and pushed the commit directly to the release branch. main/beta/httpx rulesets require status checks; a bot commit pushed straight to the branch has none → rejected. The step also ran unconditionally (no exists guard), so it fired even though 4.1.0b1 already existed and Create release was correctly skipped. The changelog content never fails the checks; it just never reaches them.

Fix

  • regenerate-library.yml: build the changelog right after the version bump, so the rendered CHANGELOG.md + consumed fragments land in the same regeneration PR and ride its required checks. towncrier is in the dev group (default-groups = ["dev"]), already installed by uv sync --group generator.
  • create-release.yml: remove the direct-push Build changelog step. By release time the changelog is already on the branch; the release body still uses --generate-notes.

No bypass actor needed — the changelog change now goes through the normal checks instead of around them.

Distribution

Branches have drifted, but the removed Build changelog step is byte-identical across main/beta/httpx, and the regen insertion is in a shared region — cherry-picks cleanly. Will cherry-pick to beta and httpx after merge (never merge main down).

Follow-up (not in this PR)

changelog.d/+httpx-migration.changed.md is still unconsumed on origin/httpx (its release was already cut). It'll fold into the next regen PR under this flow.

… push

create-release.yml's "Build changelog" step rendered CHANGELOG.md and pushed
the commit straight to the release branch (main/beta/httpx). Those branches
require status checks, and a bot commit pushed directly has none, so the push
was rejected with GH013 (run 27302232244):

    remote: error: GH013: Repository rule violations found for refs/heads/httpx
    - 9 of 9 required status checks are expected.

The step also ran unconditionally, so it fired even when the release already
existed and "Create release" was skipped. The changelog edit never fails the
checks; it just never reached them.

Move the towncrier build into regenerate-library.yml, right after the version
bump, so the rendered CHANGELOG.md and consumed fragments ride the regeneration
PR through its required checks (towncrier is in the dev group, already synced).
Drop the push step from create-release.yml; the changelog is on the branch
before the release is cut.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TKIPisalegacycipher
TKIPisalegacycipher merged commit 0904f77 into main Jun 10, 2026
2 checks passed
@TKIPisalegacycipher
TKIPisalegacycipher deleted the fix/changelog-in-regen-pr branch June 10, 2026 20:19
TKIPisalegacycipher added a commit that referenced this pull request Jun 10, 2026
… push (#402) (#403)

create-release.yml's "Build changelog" step rendered CHANGELOG.md and pushed
the commit straight to the release branch (main/beta/httpx). Those branches
require status checks, and a bot commit pushed directly has none, so the push
was rejected with GH013 (run 27302232244):

    remote: error: GH013: Repository rule violations found for refs/heads/httpx
    - 9 of 9 required status checks are expected.

The step also ran unconditionally, so it fired even when the release already
existed and "Create release" was skipped. The changelog edit never fails the
checks; it just never reached them.

Move the towncrier build into regenerate-library.yml, right after the version
bump, so the rendered CHANGELOG.md and consumed fragments ride the regeneration
PR through its required checks (towncrier is in the dev group, already synced).
Drop the push step from create-release.yml; the changelog is on the branch
before the release is cut.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TKIPisalegacycipher added a commit that referenced this pull request Jun 10, 2026
… push (#402) (#404)

create-release.yml's "Build changelog" step rendered CHANGELOG.md and pushed
the commit straight to the release branch (main/beta/httpx). Those branches
require status checks, and a bot commit pushed directly has none, so the push
was rejected with GH013 (run 27302232244):

    remote: error: GH013: Repository rule violations found for refs/heads/httpx
    - 9 of 9 required status checks are expected.

The step also ran unconditionally, so it fired even when the release already
existed and "Create release" was skipped. The changelog edit never fails the
checks; it just never reached them.

Move the towncrier build into regenerate-library.yml, right after the version
bump, so the rendered CHANGELOG.md and consumed fragments ride the regeneration
PR through its required checks (towncrier is in the dev group, already synced).
Drop the push step from create-release.yml; the changelog is on the branch
before the release is cut.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TKIPisalegacycipher added a commit that referenced this pull request Jun 10, 2026
The "Build changelog" step that pushed to the branch was removed in #402, so
this workflow no longer writes to contents. Update the stale header comment and
lower permissions from contents: write to contents: read (checkout + the
gh release view read are read-only; the release itself uses the App token).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TKIPisalegacycipher added a commit that referenced this pull request Jun 10, 2026
The "Build changelog" step that pushed to the branch was removed in #402, so
this workflow no longer writes to contents. Update the stale header comment and
lower permissions from contents: write to contents: read (checkout + the
gh release view read are read-only; the release itself uses the App token).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TKIPisalegacycipher added a commit that referenced this pull request Jun 10, 2026
The "Build changelog" step that pushed to the branch was removed in #402, so
this workflow no longer writes to contents. Update the stale header comment and
lower permissions from contents: write to contents: read (checkout + the
gh release view read are read-only; the release itself uses the App token).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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