Skip to content

Commit 37d7e90

Browse files
committed
Fix Safari & Safari Technology Preview GitHub Actions runs
We make the epochs' git-push-output have 40 character commit ids, because actions/checkout allows for ref to be a commit id, but only if it is exactly a 40 character hex string. Then, with that fixed, the Safari & Safari Technology Preview runs should start succeeding, once again able to check code out. Additionally, fix the `fetch-ref` definition so that it works in the not-workflow_run case where the output is empty.
1 parent 489a77b commit 37d7e90

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/workflows/safari_stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
safaridriver-diagnose: false
3838
matrix: '{"current-chunk": [1, 2, 3, 4, 5, 6, 7, 8], "total-chunks": [8]}'
3939
extra-options: --no-fail-on-unexpected
40-
fetch-ref: ${{ fromJSON(needs.check-workflow-run.outputs.updated-refs)['refs/heads/epochs/daily'] }}
40+
fetch-ref: ${{ fromJSON(needs.check-workflow-run.outputs.updated-refs || '{}')['refs/heads/epochs/daily'] }}

.github/workflows/safari_technology_preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
safaridriver-diagnose: false
3838
matrix: '{"current-chunk": [1, 2, 3, 4, 5, 6, 7, 8], "total-chunks": [8]}'
3939
extra-options: --no-fail-on-unexpected
40-
fetch-ref: ${{ fromJSON(needs.check-workflow-run.outputs.updated-refs)['refs/heads/epochs/three_hourly'] }}
40+
fetch-ref: ${{ fromJSON(needs.check-workflow-run.outputs.updated-refs || '{}')['refs/heads/epochs/three_hourly'] }}

tools/ci/epochs_update.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ main () {
4343
done
4444
# This is safe because `git push` will by default fail for a non-fast-forward
4545
# push, for example if the remote branch is ahead of the local branch.
46-
git push --porcelain --tags ${REMOTE} ${ALL_BRANCHES_NAMES} | tee "${RUNNER_TEMP}/git-push-output.txt"
46+
# We save the output so that GitHub Actions workflows can find out what got
47+
# pushed, as workflows are not triggered by push events caused by another
48+
# workflow. We need to pass core.abbrev as actions/checkout only allows refs to
49+
# be specified as an object id if they are exactly 40 characters.
50+
git -c core.abbrev=40 push --porcelain --tags ${REMOTE} ${ALL_BRANCHES_NAMES} | tee "${RUNNER_TEMP}/git-push-output.txt"
4751
}
4852

4953
cd $WPT_ROOT

0 commit comments

Comments
 (0)