File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 - name : Checkout
1919 uses : actions/checkout@v4
2020 with :
21- ref : ${{ github.head_ref || github.ref }}
21+ # PR builds (including forks) check out the PR head from its source repo;
22+ # push builds fall back to the pushed ref on this repo. Without the
23+ # repository override, fork-PR checkouts look for the head branch in the
24+ # base repo and fail with "a branch or tag ... could not be found".
25+ # Use the branch name (not the head SHA) so HEAD stays attached to a
26+ # branch — the KMMBridge plugin runs `git pull --tags`, which fails on a
27+ # detached HEAD with "you are not currently on a branch".
28+ repository : ${{ github.event.pull_request.head.repo.full_name || github.repository }}
29+ ref : ${{ github.event.pull_request.head.ref || github.ref }}
2230 fetch-depth : 0
2331 persist-credentials : false
2432
3846 run : ./gradlew clean build koverXmlReport --stacktrace
3947
4048 - name : Upload Coverage to Codecov
49+ # Secrets (including CODECOV_TOKEN) are not exposed to fork PRs, so the
50+ # upload would fail under fail_ci_if_error. Skip it for forks; coverage is
51+ # still uploaded and enforced for same-repo PRs and pushes to main.
52+ if : ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request' }}
4153 uses : codecov/codecov-action@v4
4254 with :
4355 token : ${{ secrets.CODECOV_TOKEN }}
You can’t perform that action at this time.
0 commit comments