Skip to content

Commit 99767f0

Browse files
committed
WIP: curl investigation
1 parent 9cc4eea commit 99767f0

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/pr-tagging.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ jobs:
2323
- name: Tag app authors
2424
env:
2525
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
PR_NUMBER: ${{ github.event.pull_request.number }}
27-
REPO: ${{ github.repository }} # this is the slug, so user/repo
26+
#PR_NUMBER: ${{ github.event.pull_request.number }}
27+
#REPO: ${{ github.repository }} # this is the slug, so user/repo
28+
COMMENT_URL: https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments
2829
run: |
2930
git diff --name-only origin/master... -- apps/ \
3031
| grep -o 'apps/[^/]*' \
@@ -39,12 +40,18 @@ jobs:
3940
4041
echo "tagging @$author for \`$d\`"
4142
done \
42-
| jq -Rsc '{body: .}' \
43-
| xargs -I{} curl \
44-
-fsSL \
45-
-H "Accept: application/vnd.github+json" \
46-
-H "Authorization: Bearer $GITHUB_TOKEN" \
47-
-H "Content-Type: application/json" \
48-
-H "X-GitHub-Api-Version: 2022-11-28" \
49-
-d {} \
50-
"https://api.github.com/repos/$REPO/issues/$PR_NUMBER/comments"
43+
> comment.txt
44+
45+
- uses: actions/github-script@v3
46+
with:
47+
github-token: ${{secrets.GITHUB_TOKEN}}
48+
script: |
49+
const fs = require("fs");
50+
const comment = fs.readFileSync("comment.txt", "utf8");
51+
52+
github.issues.createComment({
53+
issue_number: context.issue.number,
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
body: comment,
57+
})

0 commit comments

Comments
 (0)