File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 32
32
runs-on : ubuntu-latest
33
33
34
34
steps :
35
- - name : Check out the repo
36
- uses : actions/checkout@v2
35
+ - name : Get PR HEAD Ref
36
+ if : ${{ github.event_name == 'issue_comment' }}
37
+ id : getRef
38
+ run : echo "PR_REF=$(gh pr view $PR_NUMBER --repo ${{ github.repository }} --json headRefName | jq -r '.headRefName')" >> $GITHUB_OUTPUT
39
+ env :
40
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41
+
42
+ - name : Checkout source code from Github
43
+ uses : actions/checkout@v4
44
+ with :
45
+ fetch-depth : 0
46
+ ref : ${{ steps.getRef.outputs.PR_REF || github.ref }}
37
47
38
48
- name : Add GitHub Comment
39
49
if : ${{ github.event_name == 'issue_comment' }}
48
58
})
49
59
50
60
- name : Get PR number
61
+ if : ${{ github.event_name != 'issue_comment' }}
51
62
run : |
52
63
echo "GITHUB_REPOSITORY: \"$GITHUB_REPOSITORY\""
53
64
if [ -z "$PR_NUMBER" ]; then
You can’t perform that action at this time.
0 commit comments