]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
build: fix REST API call and permissions for thanks you note
authorDaniel Wagner <wagi@kernel.org>
Mon, 20 Jan 2025 09:33:36 +0000 (10:33 +0100)
committerDaniel Wagner <wagi@kernel.org>
Mon, 20 Jan 2025 09:33:36 +0000 (10:33 +0100)
The github action needs to use the correct REST API and the write
permission to be able to comment on the issue/pull request.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
.github/workflows/thanks.yml

index fc5be9d51237d05103b983c27a97c9fb24b35456..15c00bdf3ed5d8191fee30c345a36e1c6b8be20c 100644 (file)
@@ -1,3 +1,4 @@
+---
 name: Comment on Merged PR
 
 on:
@@ -9,6 +10,9 @@ jobs:
   comment-on-merge:
     if: github.event.pull_request.merged == true
     runs-on: ubuntu-latest
+    permissions:
+      issues: write
+      pull-requests: write
 
     steps:
       - name: Comment on merged PR
@@ -18,7 +22,7 @@ jobs:
             const prNumber = context.payload.pull_request.number;
             const comment = 'Thanks for your contribution!';
 
-            await github.issues.createComment({
+            await github.rest.issues.createComment({
               owner: context.repo.owner,
               repo: context.repo.repo,
               issue_number: prNumber,