Use environment variable instead of GH context

This commit is contained in:
Harry Maclean 2022-04-04 10:18:41 +12:00
Родитель c2b94e8d1d
Коммит 1cf2530feb
1 изменённых файлов: 2 добавлений и 2 удалений

4
.github/workflows/post-pr-comment.yml поставляемый
Просмотреть файл

@ -48,10 +48,10 @@ jobs:
if [ -z "$COMMENT_ID" ]
then
# Create new comment
jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" -X POST --input -
jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" -X POST --input -
else
# Update existing comment
jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" -X PATCH --input -
jq --rawfile body comment_body.txt '{"body":$body}' -n | gh api "repos/${GITHUB_REPOSITORY}/issues/comments/${COMMENT_ID}" -X PATCH --input -
fi
env:
GITHUB_TOKEN: ${{ github.token }}