-
Notifications
You must be signed in to change notification settings - Fork 1.1k
34 lines (34 loc) · 1021 Bytes
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: PR
on:
pull_request_target:
branches: [main]
types: [opened]
permissions:
contents: read
jobs:
close:
permissions:
contents: read
# We have to use two different APIs below,
# so just grant two different permissions.
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
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',
}));