Skip to content

Commit 1dcdfc5

Browse files
authored
fix(ci): test script not working on fork
1 parent 15c75f3 commit 1dcdfc5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/test_action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v2
1212
with:
13+
ref: ${{ github.head_ref }}
1314
fetch-depth: 0 # ensures that tags are fetched, seems to be needed
1415
- name: Capture commit id
1516
id: capture
1617
run: |
17-
COMMIT_ID=$(git rev-parse origin/${{ github.head_ref }})
18+
COMMIT_ID=$(git rev-parse ${{ github.head_ref }})
1819
echo "The sha of the starting commit is $COMMIT_ID"
1920
echo "::set-output name=commit::$COMMIT_ID"
2021
- name: create test commit
@@ -32,7 +33,7 @@ jobs:
3233
push: false
3334
- name: Test push
3435
run: |
35-
last_pushed_commit=$(git rev-parse origin/${{ github.head_ref }})
36+
last_pushed_commit=$(git rev-parse ${{ github.head_ref }})
3637
echo "Commit sha on origin : $last_pushed_commit"
3738
if [[ $last_pushed_commit != ${{steps.capture.outputs.commit}} ]]; then
3839
echo "Something got pushed to ${{ github.head_ref }}"

0 commit comments

Comments
 (0)