Close all GitHub pull requests automatically.
Change-Id: Ie0849214f578b47d6da2a50205501f42b1572a52
Reviewed-on: https://code-review.googlesource.com/c/re2/+/59692
Reviewed-by: Jeff Bailey <jeffbailey@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 0000000..9de006d
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,26 @@
+name: PR
+on:
+ pull_request:
+ branches: [main]
+ types: [opened]
+jobs:
+ close:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/github-script@v5
+ with:
+ script: |
+ const fs = require('fs');
+ console.log(await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ body: fs.readFileSync('CONTRIBUTING.md', { encoding: 'utf8', }),
+ }));
+ console.log(await github.rest.pulls.update({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: context.issue.number,
+ state: 'closed',
+ }));
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 3af2b0a..882b0e2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,2 +1,2 @@
RE2 uses Gerrit instead of GitHub pull requests.
-See the [Contributing](https://github.com/google/re2/wiki/Contribute) wiki page.
+See the [Contribute](https://github.com/google/re2/wiki/Contribute) wiki page.