Repository navigation
ci(release): publish from the protected release environment with project-scoped tokens - #558
Open
mlieberman85 wants to merge 1 commit into
Open
mlieberman85 wants to merge 1 commit into
mlieberman85 wants to merge 1 commit into
Conversation
…ect-scoped tokens PYPI_API_TOKEN was an account-scoped repository secret, readable by any workflow run in the repository. Each publish job now runs in the release environment (required reviewers, deployments only from v* tags or main) and reads its own project-scoped token from that environment. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Michael Lieberman <mlieberman85@gmail.com>
This was referenced Oct 6, 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.
Summary
The PyPI credential is currently
PYPI_API_TOKEN, an account-scoped repository secret. Any workflow run in the repository can read it, so anyone with write access could read or use it from a branch. This PR gates publishing:publish-*job inrelease.ymlruns inenvironment: release.PYPI_TOKEN_DARNIT_CORE,PYPI_TOKEN_DARNIT_BASELINE,PYPI_TOKEN_DARNIT_GITTUF,PYPI_TOKEN_DARNIT_REPRODUCIBILITY,PYPI_TOKEN_DARNIT_MCP.packaging/README.mddocuments the setup.The
releaseenvironment is already configured:v*tags and themainbranch (mainis for theworkflow_dispatchre-release path).Before the next release (maintainer steps)
releaseenvironment secret. The commands are inpackaging/README.md.gh secret delete PYPI_API_TOKEN --repo darnitdevorg/darnit.Until step 1 is done, a release's publish jobs fail with a 403 and nothing is published.
Type of Change
This is a CI and release-process security change; product code is unchanged.
Testing
uv run pytest tests/ -v): not applicable, no product code changedactionlint .github/workflows/release.ymlAI assistance
Claude (Claude Code, claude-opus-5-5) found the exposure, configured the
releaseenvironment through the API at my direction, and made this change. This description was also drafted with Claude. The commit carries anAssisted-by: Claude:claude-opus-5-5trailer.Additional Notes
environment: release.parity-tier2andparity-tier2-openaiand say they are "gated with required reviewers", but neither environment exists. A dispatched run would create them unprotected, and fail for lack of secrets.🤖 Generated with Claude Code