Skip to content

Commit d98c3fd

Browse files
committed
Close all GitHub pull requests automatically.
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]>
1 parent 0d39dec commit d98c3fd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/pr.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PR
2+
on:
3+
pull_request:
4+
branches: [main]
5+
types: [opened]
6+
jobs:
7+
close:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/github-script@v5
12+
with:
13+
script: |
14+
const fs = require('fs');
15+
console.log(await github.rest.issues.createComment({
16+
owner: context.repo.owner,
17+
repo: context.repo.repo,
18+
issue_number: context.issue.number,
19+
body: fs.readFileSync('CONTRIBUTING.md', { encoding: 'utf8', }),
20+
}));
21+
console.log(await github.rest.pulls.update({
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
pull_number: context.issue.number,
25+
state: 'closed',
26+
}));

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
RE2 uses Gerrit instead of GitHub pull requests.
2-
See the [Contributing](https://github.com/google/re2/wiki/Contribute) wiki page.
2+
See the [Contribute](https://github.com/google/re2/wiki/Contribute) wiki page.

0 commit comments

Comments
 (0)