Skip to content

Commit 9435e77

Browse files
lightseyatoomic
authored andcommitted
Fix github action testing of pull requests on cygwin
The GITHUB_REF head on the remote doesn't reliably contain GITHUB_SHA when testing pull requests. These PR merge SHAs are likely transient. Checkout whatever the fetch retrieved from GITHUB_REF instead.
1 parent ad9dfdb commit 9435e77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/testsuite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ jobs:
386386
shell: cmd
387387
run: |
388388
path %GITHUB_WORKSPACE%\cygwin\bin;%GITHUB_WORKSPACE%\cygwin\usr\bin
389-
sh -c "mkdir -p ~; cd ~; echo \"$GITHUB_REPOSITORY\"; git clone -qn \"https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY\" work ; cd work ; if [ \"$GITHUB_EVENT_NAME\" = pull_request ] ; then git fetch origin \"$GITHUB_REF\" ; fi ; git checkout \"$GITHUB_SHA\""
389+
sh -c "mkdir -p ~; cd ~; echo \"$GITHUB_REPOSITORY\"; git clone -qn \"https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY\" work ; cd work ; if [ \"$GITHUB_EVENT_NAME\" = pull_request ] ; then git fetch origin \"$GITHUB_REF\" && git checkout FETCH_HEAD ; else git checkout \"$GITHUB_SHA\" ; fi"
390390
- name: Configure
391391
shell: cmd
392392
run: |

0 commit comments

Comments
 (0)