fix(ci): release through protected main via explicit dispatch - #8
Merged
Conversation
The release workflow has failed on every push to main since 2026-02-18. It
pushes the python-semantic-release version-bump commit and tag directly to
main with the default GITHUB_TOKEN, and branch protection on main requires a
pull request:
remote: error: GH006: Protected branch update failed for refs/heads/main.
remote: - Changes must be made through a pull request.
The failing push happens before the build and publish steps, so no failing run
ever published anything: PyPI, the git tag, the GitHub Release, and
pyproject.toml still agree. openadapt-privacy hit the identical failure on the
same day and was repaired on 2026-07-15 (fix(ci): release through protected
main); this is the same repair.
- Use secrets.ADMIN_TOKEN, the organization-scoped release credential already
used by openadapt-flow and openadapt-privacy. Branch protection here has
enforce_admins=false, so an admin credential can push the release commit;
GITHUB_TOKEN cannot.
- Trigger on workflow_dispatch instead of push, matching openadapt-flow.
Releasing becomes an explicit act, keeps release minutes off every push
(AGENTS.md 5.1), and avoids publishing a version whose only content since
the last tag is CI config, .gitignore, and docs.
Also repoint the README build badge at release.yml; it referenced a
publish.yml workflow that does not exist in this repository, so the badge was
permanently broken.
Merging this changes no published artifact. The next release is whenever a
maintainer dispatches the workflow.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NyCHrzA1psrKMFfroYbzaM
This was referenced Jul 28, 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.
The failure
Release and PyPI Publishhas failed on every push tomainsince 2026-02-18. The cause is in the log of the newest run:python-semantic-releasecomputes the next version, commits the bump, tags it, and pushes tomain.mainrequires a pull request, and the defaultGITHUB_TOKENis not an admin, so the push is rejected. Branch protection was enabled some time after the last successful release run (2026-01-29); the workflow file and token were unchanged.Nothing was silently unpublished
The rejected push is the step before build and publish, and every later step is gated on
steps.release.outputs.released == 'true'. So no failing run ever published. The published state and the repository state still agree — PyPI version = git tag = GitHub Release =pyproject.toml. What stopped is releasing, not correctness; and the commits since the last tag are CI config,.gitignore, and docs only, with no library code changed.openadapt-privacyhit the identical failure on the same day and was repaired on 2026-07-15 (fix(ci): release through protected main, #5). Its release runs have been green since. This is the same repair, applied to the three repositories that were left behind.The change
secrets.ADMIN_TOKEN— the organization-scoped release credential (visibilityall) already used byopenadapt-flowandopenadapt-privacy. Branch protection here setsenforce_admins: false, so an admin credential can push the release commit and tag;GITHUB_TOKENcannot.workflow_dispatchinstead ofpush— matching the canonicalopenadapt-flowrelease workflow. Releasing becomes an explicit act rather than a side effect of merging a README edit, and release minutes come off every push (AGENTS.md 5.1).Also repoints the README build badge at
release.yml. It referenced apublish.ymlworkflow that does not exist in this repository, so the badge was permanently broken.Release safety
Merging this publishes nothing. With the
pushtrigger removed, merging cannot start a release run. The next release happens only when a maintainer runs:This is deliberate: with the
pushtrigger kept, merging this PR would itself have cut a patch release whose only content since the last tag is a CI-config change.Known follow-up
The last
Release and PyPI Publishrun onmainremains red inbin/oa-green, because a dispatch-only workflow produces no new run to supersede it. It clears on the first dispatched release.🤖 Generated with Claude Code
https://claude.ai/code/session_01NyCHrzA1psrKMFfroYbzaM