fix(ci): allow unit tests to run on fork PRs without app secrets - #556
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
The unit-test job had create-github-app-token as its first step, which fails on pull_request events from forks because repository secrets are not available. This aborted the entire job before checkout or tests could run. Reorder: move the token step to after test execution (it only feeds the JUnit report publisher). Add continue-on-error so the token failure doesn't abort the job. When the app token is unavailable (fork PRs), fall back to the read-only GITHUB_TOKEN with annotate_only mode — the action's documented fork-PR path that annotates without creating a check run (which requires checks: write, unavailable on fork PRs).
wax911
force-pushed
the
fix/ci-fork-pr-token-access
branch
from
September 9, 2026 18:31
728b1ee to
76eab45
Compare
wax911
added a commit
to yoobi/android-emojify
that referenced
this pull request
Sep 9, 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.
Problem
The
unit-testjob hadactions/create-github-app-token@v3as its first step. Forpull_requestevents from forks, repository secrets (APP_ID,APP_PRIVATE_KEY) are not available (Secret source: None), so the token step fails immediately:This aborts the entire job before checkout or tests run — the 6-second runtime on #552's last CI run was entirely this failure, not a test failure.
This was masked by the
adopttotemurindistribution issue (#555, merged) which blocked all jobs earlier at Set up JDK. With that fixed, this second layer surfaced.Fix
Reorder the
unit-testjob so tests run first:Checkout, Common setup, Run tests — execute before any token creation, so tests always run.
create-github-app-token — moved after tests, with
continue-on-error: true. It only feeds the JUnit report publisher; a token failure on fork PRs no longer aborts the job.Publish Test Report — uses
${{ steps.app-token.outputs.token || github.token }}to fall back to the defaultGITHUB_TOKEN(available on fork PRs with read permissions) when the app token is unavailable.Verification
Secret source: NonethenThe 'client-id' input must be set to a non-empty string, not a test failure.gradle-dokkajob is unaffected — it already hasif: github.event_name == 'push', so it never runs on PRs.Impact
Unblocks fork PRs like #552 from running unit tests in CI. Once this merges, #552's CI should go fully green (Spotless already passing after #555, Unit Tests after this fix).