Skip to content

Commit 831e888

Browse files
noreplyclaude
andcommitted
Fork CI: give fork-ci-result actions: read for the job wall times
The job list API needs it; a failed call now warns in the log instead of failing silently. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 95935ce commit 831e888

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎.github/workflows/fork-tests.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,9 @@ jobs:
832832
]
833833
runs-on: ubuntu-24.04
834834
timeout-minutes: 5
835+
# The job list API needs actions: read; nothing here checks out code.
836+
permissions:
837+
actions: read
835838
steps:
836839
- name: Require every job to pass
837840
env:
@@ -884,16 +887,18 @@ jobs:
884887
name: thread-transfer-results
885888
path: ${{ runner.temp }}/thread-transfer
886889

887-
# Information only: read from the public run's job list, never fails the run.
890+
# Information only: read from the run's job list, never fails the run.
888891
- name: Job wall times
889892
if: always()
890893
env:
891894
GH_TOKEN: ${{ github.token }}
892895
run: |
893-
jobs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT/jobs?per_page=100" 2>/dev/null) || {
896+
jobs=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/attempts/$GITHUB_RUN_ATTEMPT/jobs?per_page=100") || {
897+
echo "::warning::Job timings unavailable: the job list API call failed."
894898
echo "Job timings unavailable." >> "$GITHUB_STEP_SUMMARY"
895899
exit 0
896900
}
901+
echo "Job timings for $(echo "$jobs" | jq '.jobs | length') jobs."
897902
{
898903
echo
899904
echo "#### Job wall times"

0 commit comments

Comments
 (0)