File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,11 +41,20 @@ jobs:
4141 echo "Contains @gemini: ${{ contains(github.event.comment.body, '@gemini') }}"
4242 echo "Comment author: ${{ github.event.comment.user.login }}"
4343
44+ - name : Determine checkout ref
45+ id : checkout_ref
46+ run : |
47+ if [ "${{ github.event_name }}" = "issue_comment" ]; then
48+ echo "ref=refs/pull/${{ github.event.issue.number }}/head" >> "$GITHUB_OUTPUT"
49+ else
50+ echo "ref=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
51+ fi
52+
4453 - name : Checkout PR code
4554 uses : actions/checkout@v4
4655 with :
4756 token : ${{ steps.generate_token.outputs.token }}
48- ref : ${{ github.event_name == 'issue_comment' && 'refs/pull/${{ github.event.issue.number }}/head' || github.event.pull_request.head.sha }}
57+ ref : ${{ steps.checkout_ref.outputs.ref }}
4958 fetch-depth : 0
5059
5160 - name : Get PR details
You can’t perform that action at this time.
0 commit comments