2323# questions.
2424#
2525
26- # Fires in the upstream repo context when a fork PR is opened or updated.
26+ # Fires in the upstream repo context when a PR from a fork is opened or updated.
2727# Polls the fork repo's Actions API for the "SapMachine GHA Sanity Checks"
2828# run on the PR head commit, then mirrors every individual job as a native
2929# Check Run on the upstream PR — matching the appearance of the fork's own
3030# checks tab. No submit branches are created; no CI is re-run upstream.
31- name : ' Pre-submit tests '
31+ name : ' Mirror Checks from Source Fork '
3232
3333on :
3434 pull_request_target :
3737 - synchronize
3838 - reopened
3939
40+ concurrency :
41+ group : ${{ github.workflow }}-${{ github.ref }}
42+ cancel-in-progress : true
43+
4044permissions :
4145 checks : write
4246 pull-requests : read
4347
4448jobs :
4549 mirror :
46- name : ' Mirror fork CI result '
50+ name : ' Sync Actions from Fork '
4751 runs-on : ubuntu-24.04
4852 # Only act on fork PRs — same-repo PRs get CI directly from main.yml.
4953 if : github.event.pull_request.head.repo.full_name != github.repository
@@ -65,15 +69,15 @@ jobs:
6569
6670 while [[ $ATTEMPT -lt $MAX_WAIT ]]; do
6771 ATTEMPT=$((ATTEMPT + 1))
68- echo "Waiting for fork workflow run (attempt ${ATTEMPT}/${MAX_WAIT})..."
72+ echo "Waiting for workflow run on fork (attempt ${ATTEMPT}/${MAX_WAIT})..."
6973
7074 RUN_ID=$(gh api \
7175 "repos/${FORK_REPO}/actions/runs?head_sha=${HEAD_SHA}&per_page=10" \
7276 --jq '.workflow_runs[] | select(.name == "SapMachine GHA Sanity Checks") | .id' \
7377 2>/dev/null | head -1)
7478
7579 if [[ -n "$RUN_ID" && "$RUN_ID" != "null" ]]; then
76- echo "Found fork workflow run: ${RUN_ID}"
80+ echo "Found workflow run on fork : ${RUN_ID}"
7781 break
7882 fi
7983
@@ -88,15 +92,15 @@ jobs:
8892 2>/dev/null | head -1)
8993
9094 if [[ -n "$RUN_ID" && "$RUN_ID" != "null" ]]; then
91- echo "Found fork workflow run via PR fallback: ${RUN_ID}"
95+ echo "Found workflow run on fork via PR fallback: ${RUN_ID}"
9296 break
9397 fi
9498
9599 sleep 60
96100 done
97101
98102 if [[ -z "$RUN_ID" || "$RUN_ID" == "null" ]]; then
99- echo "No fork workflow run found within ${MAX_WAIT} minutes — giving up."
103+ echo "No workflow run found on fork within ${MAX_WAIT} minutes — giving up."
100104 exit 1
101105 fi
102106
@@ -108,7 +112,7 @@ jobs:
108112 # job name → fork job HTML URL
109113 declare -A JOB_URLS
110114
111- MAX_POLL=90
115+ MAX_POLL=180
112116 POLL=0
113117 OVERALL_CONCLUSION=""
114118
@@ -184,11 +188,11 @@ jobs:
184188 --jq '{status: .status, conclusion: .conclusion}' \
185189 2>/dev/null)
186190
187- RUN_STATUS=$(echo "$RUN_JSON" | jq -r '.status')
191+ RUN_STATUS=$(echo "$RUN_JSON" | jq -r '.status')
188192 OVERALL_CONCLUSION=$(echo "$RUN_JSON" | jq -r '.conclusion')
189193
190194 if [[ "$RUN_STATUS" == "completed" ]]; then
191- echo "Fork workflow run completed with conclusion: ${OVERALL_CONCLUSION}"
195+ echo "Workflow run on fork completed with conclusion: ${OVERALL_CONCLUSION}"
192196 # Do one final job sync to catch any jobs that finished in this last window.
193197 JOBS_JSON=$(gh api \
194198 "repos/${FORK_REPO}/actions/runs/${RUN_ID}/jobs?per_page=100" \
0 commit comments