fix(CI): replace pypa/gh-action-pypi-publish with inline twine upload#933
Open
yangxk1 wants to merge 1 commit into
Open
fix(CI): replace pypa/gh-action-pypi-publish with inline twine upload#933yangxk1 wants to merge 1 commit into
yangxk1 wants to merge 1 commit into
Conversation
The pypa/gh-action-pypi-publish action is blocked by Apache org's action allowlist policy. Replace it with inline shell steps that use PyPI's trusted publisher OIDC flow directly: mint a short-lived API token via the OIDC endpoint and upload with twine. The id-token: write permission is preserved so GitHub Actions still injects the OIDC credentials needed for the trusted publisher exchange.
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.
Reason for this PR
The
pypa/gh-action-pypi-publishaction is not in the Apache organization's GitHub Actions allowlist, causing theupload_test_pypiandupload_pypijobs to fail with:See: https://github.com/apache/incubator-graphar/actions/runs/27183446921
What changes are included in this PR?
Replace both uses of
pypa/gh-action-pypi-publishwith inline shell steps that perform the same trusted publisher OIDC flow directly:id-token: writepermission)_/oidc/mint-tokenendpointtwineAdditionally,
::add-mask::is used to prevent the minted token from leaking in CI logs.Are these changes tested?
The OIDC flow follows PyPI's official trusted publisher documentation. The workflow YAML has been validated for correct syntax. The actual upload will be tested when the workflow runs on the next push to
main.Are there any user-facing changes?
No. The publishing behavior is identical — packages are still uploaded via PyPI trusted publishing (OIDC). Only the CI implementation changes.
Checklist
make cpplintbefore submitting when changed files are in thecppdirectory.pre-commit runbefore commit the changed files.