23
23
- name : Tag app authors
24
24
env :
25
25
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
28
29
run : |
29
30
git diff --name-only origin/master... -- apps/ \
30
31
| grep -o 'apps/[^/]*' \
@@ -39,12 +40,18 @@ jobs:
39
40
40
41
echo "tagging @$author for \`$d\`"
41
42
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