Skip to content

Commit b9bf597

Browse files
committed
Address comments
1 parent 18a4722 commit b9bf597

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/post-pr-comment.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- 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"
1717
env:
1818
GITHUB_TOKEN: ${{ github.token }}
19+
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
1920
- 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)"
2223
# Check that the pull-request head SHA matches the head SHA of the workflow run
2324
if [ "${WORKFLOW_RUN_HEAD_SHA}" != "${PR_HEAD_SHA}" ]; then
2425
exit 1
2526
fi
26-
cat comment.txt | gh pr comment "${PR}" --repo "${{ github.repository }}" -F -
27+
gh pr comment "${PR}" --repo "${GITHUB_REPOSITORY}" -F comment.txt
2728
env:
2829
GITHUB_TOKEN: ${{ github.token }}
2930
WORKFLOW_RUN_HEAD_SHA: ${{ github.event.workflow_run.head_commit.id }}

0 commit comments

Comments
 (0)