6
6
7
7
jobs :
8
8
mention-app-authors :
9
+ permissions : write-all
9
10
runs-on : ubuntu-latest
10
11
steps :
11
12
- uses : actions/checkout@v4
23
24
- name : Tag app authors
24
25
env :
25
26
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26
- PR_NUMBER : ${{ github.event.pull_request.number }}
27
- REPO : ${{ github.repository }} # this is the slug, so user/repo
27
+ # PR_NUMBER: ${{ github.event.pull_request.number }}
28
+ # REPO: ${{ github.repository }} # this is the slug, so user/repo
29
+ COMMENT_URL : https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments
28
30
run : |
29
31
git diff --name-only origin/master... -- apps/ \
30
32
| grep -o 'apps/[^/]*' \
@@ -39,12 +41,18 @@ jobs:
39
41
40
42
echo "tagging @$author for \`$d\`"
41
43
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"
44
+ > comment.txt
45
+
46
+ - uses : actions/github-script@v7
47
+ with :
48
+ github-token : ${{secrets.GITHUB_TOKEN}}
49
+ script : |
50
+ const fs = require("fs");
51
+ const comment = fs.readFileSync("comment.txt", "utf8");
52
+
53
+ github.rest.issues.createComment({
54
+ issue_number: context.issue.number,
55
+ owner: context.repo.owner,
56
+ repo: context.repo.repo,
57
+ body: comment,
58
+ })
0 commit comments