Repository navigation
ci(android): let pull requests from forks build - #2710
Open
cuong-tran wants to merge 1 commit into
Open
cuong-tran wants to merge 1 commit into
cuong-tran wants to merge 1 commit into
Conversation
A pull request from a fork gets no repository secrets, so the Full build's Sentry mapping upload ran with an empty auth token and failed with a 401 after the APK had already built, failing every fork PR. Upload the mapping only when a token is present (the plugin then runs sentry-cli with --no-upload), and skip signing and the artifact upload for fork PRs, which have no signing key either.
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.
What & why
Every pull request from a fork fails "Build release APK (FOSS)", in both
buildandbuild-vivo, while pushes todevpass. GitHub gives no repository secrets topull_requestruns from forks, solocal.propertiesgets an emptySENTRY_AUTH_TOKEN. The Full build still hadautoUploadProguardMappingon, so after the APK had already built,uploadSentryProguardMappingsReleasefailed:Seen on #2709 (run 39217097153) and on earlier fork PRs (runs 38939224887, 35792460797).
androidAppandvivoAndroidApp: upload the mapping only when a token is present. Without one, the Sentry plugin runssentry-cli upload-proguard --no-upload, which still writes the mapping UUID but makes no API call. Builds with the secret behave exactly as before. A local Full build without a token now succeeds too.android.yml: skip signing and the artifact upload for pull requests from forks, which have no signing key either. Pushes and same-repo PRs still sign and upload.Trade-off: if the
SENTRY_AUTH_TOKENsecret ever goes missing upstream, the mapping upload is skipped silently instead of failing the build.Linked issue
No issue: this fixes the CI failure seen on fork PRs such as #2709.
Checklist
CI only, no app code changed. This PR comes from a fork, so its own check run is the test: both jobs should pass, with the sign and upload steps skipped.