Skip to content

ci: declare contents:read on Android publish workflow#104

Merged
kiftio merged 2 commits into
Shopify:mainfrom
arpitjain099:chore/android-publish-permissions
May 14, 2026
Merged

ci: declare contents:read on Android publish workflow#104
kiftio merged 2 commits into
Shopify:mainfrom
arpitjain099:chore/android-publish-permissions

Conversation

@arpitjain099
Copy link
Copy Markdown
Contributor

The Android — Publish to Maven Central workflow runs on release: published and uses external secrets for the Sonatype upload path:

  • OSSRH_USERNAME / OSSRH_PASSWORD for ./gradlew publishReleasePublicationToOssrh-staging-apiRepository
  • OSSRH_GPG_SECRET_KEY* for signing
  • a base64-encoded OSSRH_USERNAME:OSSRH_PASSWORD for the staging-API repo lookup

None of those use the workflow's GITHUB_TOKEN. The job only needs contents: read for actions/checkout.

This patch adds that block at the job level, matching the per-job permission style already used by ci.yml (workflow-level contents: read, pull-requests: read plus per-job pull-requests: write on the rn-test caller), cla.yml, stale.yml, and swift-update-linters.yml.

Out of scope for this PR:

  • swift-publish.yml uses ruby/setup-ruby with bundler-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-repo API calls keep using their existing secrets.

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>
@arpitjain099 arpitjain099 requested a review from a team as a code owner May 14, 2026 02:34
@kiftio
Copy link
Copy Markdown
Contributor

kiftio commented May 14, 2026

Looks good, if you can sign the CLA, we can merge in

@arpitjain099
Copy link
Copy Markdown
Contributor Author

Looks good, if you can sign the CLA, we can merge in

@kiftio thank you, I just signed the CLA. How should I run the checks for this PR again.

@kiftio kiftio merged commit 27c5cce into Shopify:main May 14, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants