Uh oh!
There was an error while loading. Please reload this page.
CI: fix id-token permission for "Test wheels building" - #820
Conversation
build-test.yml triggers on pull_request, which gives it id-token:none by default. lib-build-and-push.yml's upload_pypi job declares id-token:write, which exceeds the caller's cap and causes GitHub to reject the workflow at parse time — even though upload:false prevents upload_pypi from ever running. Fix: explicitly grant id-token:write to the test-wheels-build job so the permission cap satisfies the reusable workflow's requirement. Fixesscylladb#819
Lorak-mmk
commented
Apr 15, 2026
This also gives unnecessary permissions to the whole workflow, no? This job could run perfectly well without write permissions, but now it has them. |
Uh oh!
There was an error while loading. Please reload this page.
nikagra
commented
Apr 17, 2026
@Lorak-mmk This change only adds permissions: id-token: writeto that job, not the whole workflow. It does not grant general repository write permissions (e.g., |
nikagra
commented
Apr 17, 2026
@Lorak-mmk Created issue #824 |
…-build.yml Closesscylladb#824. Follow-up to scylladb#820. The upload_pypi job in lib-build-and-push.yml was never reachable: none of the four caller workflows pass upload: true. build-push.yml and publish-manually.yml already publish from their own separate jobs (necessary due to how PyPI Trusted Publishing embeds the caller workflow path in the OIDC token). Because the reusable workflow declared 'permissions: id-token: write' for upload_pypi, GitHub's static permission validation forced build-test.yml (a pull_request workflow, which defaults to id-token: none) to also declare id-token: write — granting unnecessary privileges to a job that only builds wheels. Changes: - Rename lib-build-and-push.yml -> lib-build.yml (it only builds now) - Remove upload input and upload_pypi job from the reusable workflow - Remove 'permissions: id-token: write' and 'with: upload: false' from build-test.yml (no longer needed) - Update all callers (build-push.yml, publish-manually.yml, build-pre-release.yml) to reference the new workflow path and drop upload: false from with: blocks - Replace TODO comments in build-push.yml and publish-manually.yml with an explanatory comment: the separate publish job is now intentional design, not a temporary workaround
…-build.yml Closes#824. Follow-up to #820. The upload_pypi job in lib-build-and-push.yml was never reachable: none of the four caller workflows pass upload: true. build-push.yml and publish-manually.yml already publish from their own separate jobs (necessary due to how PyPI Trusted Publishing embeds the caller workflow path in the OIDC token). Because the reusable workflow declared 'permissions: id-token: write' for upload_pypi, GitHub's static permission validation forced build-test.yml (a pull_request workflow, which defaults to id-token: none) to also declare id-token: write — granting unnecessary privileges to a job that only builds wheels. Changes: - Rename lib-build-and-push.yml -> lib-build.yml (it only builds now) - Remove upload input and upload_pypi job from the reusable workflow - Remove 'permissions: id-token: write' and 'with: upload: false' from build-test.yml (no longer needed) - Update all callers (build-push.yml, publish-manually.yml, build-pre-release.yml) to reference the new workflow path and drop upload: false from with: blocks - Replace TODO comments in build-push.yml and publish-manually.yml with an explanatory comment: the separate publish job is now intentional design, not a temporary workaround
Summary
Fixes#819.
build-test.ymlis triggered bypull_request, which implicitly grantsid-token: none. The reusablelib-build-and-push.ymlcontains anupload_pypijob declaringid-token: write. GitHub enforces permissions at parse time — before evaluating anyif:conditions — so the entire workflow is rejected even thoughupload: falsemeansupload_pypinever actually runs.Fix
Add
permissions: id-token: writeto thetest-wheels-buildjob inbuild-test.yml. This satisfies GitHub's static validation while keeping the runtime behaviour unchanged —upload_pypiis still skipped viaif: inputs.upload.Verification
Tested on PR #770 by temporarily applying this change; the
Test wheels buildingjobs transitioned from immediate parse-time failure to successful completion across all platforms (linux, linux-aarch64, macos-arm, macos-x86, windows).