ci: declare contents:read on Android publish workflow#104
Merged
kiftio merged 2 commits intoMay 14, 2026
Conversation
The Android publish job uses OSSRH_USERNAME/PASSWORD and the GPG signing secrets to run `./gradlew publishReleasePublicationToOssrh-staging-apiRepository`, then queries the OSSRH API with a base64-encoded token for the repo id. None of those paths use the workflow GITHUB_TOKEN, so contents:read is the floor. Style matches the per-job permissions blocks in ci.yml (contents:read + pull-requests:read at workflow scope; per-job pull-requests:write only on the rn-test caller) and the workflow-level blocks in cla.yml, stale.yml, swift-update-linters.yml. swift-publish.yml left out because it uses ruby/setup-ruby with bundler-cache:true, which interacts with the cache-save path. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
Contributor
|
Looks good, if you can sign the CLA, we can merge in |
Contributor
Author
@kiftio thank you, I just signed the CLA. How should I run the checks for this PR again. |
kiftio
approved these changes
May 14, 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
Android — Publish to Maven Centralworkflow runs onrelease: publishedand uses external secrets for the Sonatype upload path:OSSRH_USERNAME/OSSRH_PASSWORDfor./gradlew publishReleasePublicationToOssrh-staging-apiRepositoryOSSRH_GPG_SECRET_KEY*for signingOSSRH_USERNAME:OSSRH_PASSWORDfor the staging-API repo lookupNone of those use the workflow's
GITHUB_TOKEN. The job only needscontents: readforactions/checkout.This patch adds that block at the job level, matching the per-job permission style already used by
ci.yml(workflow-levelcontents: read, pull-requests: readplus per-jobpull-requests: writeon the rn-test caller),cla.yml,stale.yml, andswift-update-linters.yml.Out of scope for this PR:
swift-publish.ymlusesruby/setup-rubywithbundler-cache: true. Declaring permissions there has to account for the cache-save path, which deserves a separate look.No behavioural change. The OSSRH publish path and downstream
find-repo/release-repoAPI calls keep using their existing secrets.