File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,18 @@ jobs:
13
13
runs-on : ubuntu-latest
14
14
steps :
15
15
- name : Download artifact
16
- run : gh run download "${{ github.event.workflow_run.id }} " --repo "${{ github.repository } }" --name "comment"
16
+ run : gh run download "${WORKFLOW_RUN_ID} " --repo "${GITHUB_REPOSITORY }" --name "comment"
17
17
env :
18
18
GITHUB_TOKEN : ${{ github.token }}
19
+ WORKFLOW_RUN_ID : ${{ github.event.workflow_run.id }}
19
20
- run : |
20
- PR=$(grep -o '^[0-9]\+$' pr.txt)
21
- PR_HEAD_SHA=$(gh api "/repos/${{ github.repository }} /pulls/${PR}" --jq .head.sha)
21
+ PR=" $(grep -o '^[0-9]\+$' pr.txt)"
22
+ PR_HEAD_SHA=" $(gh api "/repos/${GITHUB_REPOSITORY} /pulls/${PR}" --jq .head.sha)"
22
23
# Check that the pull-request head SHA matches the head SHA of the workflow run
23
24
if [ "${WORKFLOW_RUN_HEAD_SHA}" != "${PR_HEAD_SHA}" ]; then
24
25
exit 1
25
26
fi
26
- cat comment.txt | gh pr comment "${PR}" --repo "${{ github.repository }} " -F -
27
+ gh pr comment "${PR}" --repo "${GITHUB_REPOSITORY} " -F comment.txt
27
28
env:
28
29
GITHUB_TOKEN: ${{ github.token }}
29
30
WORKFLOW_RUN_HEAD_SHA: ${{ github.event.workflow_run.head_commit.id }}
You can’t perform that action at this time.
0 commit comments