Skip to content

Commit

Permalink
Close all GitHub pull requests automatically.
Browse files Browse the repository at this point in the history
Change-Id: Ie0849214f578b47d6da2a50205501f42b1572a52
Reviewed-on: https://code-review.googlesource.com/c/re2/+/59692
Reviewed-by: Jeff Bailey <[email protected]>
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Jan 27, 2022
1 parent 0d39dec commit d98c3fd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -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',
}));
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit d98c3fd

Please sign in to comment.