File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 runs-on : ubuntu-latest
3333
3434 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 }}
3747
3848 - name : Add GitHub Comment
3949 if : ${{ github.event_name == 'issue_comment' }}
4858 })
4959
5060 - name : Get PR number
61+ if : ${{ github.event_name != 'issue_comment' }}
5162 run : |
5263 echo "GITHUB_REPOSITORY: \"$GITHUB_REPOSITORY\""
5364 if [ -z "$PR_NUMBER" ]; then
You can’t perform that action at this time.
0 commit comments