Browse Source

Revert to issues.createComment with proper permissions

Noah Zweben MacBook 8 months ago
parent
commit
ff3447566e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      .github/workflows/close-external-prs.yml

+ 4 - 4
.github/workflows/close-external-prs.yml

@@ -6,6 +6,7 @@ on:
 
 
 permissions:
 permissions:
   pull-requests: write
   pull-requests: write
+  issues: write
 
 
 jobs:
 jobs:
   check-membership:
   check-membership:
@@ -27,12 +28,11 @@ jobs:
               console.log(`${author} is an org member, allowing PR`);
               console.log(`${author} is an org member, allowing PR`);
             } catch (e) {
             } catch (e) {
               if (e.status === 404) {
               if (e.status === 404) {
-                await github.rest.pulls.createReview({
+                await github.rest.issues.createComment({
                   owner: context.repo.owner,
                   owner: context.repo.owner,
                   repo: context.repo.repo,
                   repo: context.repo.repo,
-                  pull_number: context.payload.pull_request.number,
-                  body: `Thanks for your interest! This repo only accepts contributions from Anthropic team members. If you'd like to submit a plugin to the marketplace, please submit your plugin [here](https://docs.google.com/forms/d/e/1FAIpQLSdeFthxvjOXUjxg1i3KrOOkEPDJtn71XC-KjmQlxNP63xYydg/viewform).`,
-                  event: 'COMMENT'
+                  issue_number: context.payload.pull_request.number,
+                  body: `Thanks for your interest! This repo only accepts contributions from Anthropic team members. If you'd like to submit a plugin to the marketplace, please submit your plugin [here](https://docs.google.com/forms/d/e/1FAIpQLSdeFthxvjOXUjxg1i3KrOOkEPDJtn71XC-KjmQlxNP63xYydg/viewform).`
                 });
                 });
 
 
                 await github.rest.pulls.update({
                 await github.rest.pulls.update({