-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
32 lines (29 loc) · 933 Bytes
/
Copy pathmerge_contributions_pr.yml
File metadata and controls
32 lines (29 loc) · 933 Bytes
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
name: Merge contributions PR
on:
pull_request_target:
types:
- opened
- reopened
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code 👋
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Check and merge ⛙
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
with:
github-token: ${{ secrets.GH_PAT }}
script: |
const { repo: { owner, repo } } = context;
const pr = context.payload.pull_request;
if (pr.user.id !== 46447321) {
console.log('Not an all-contributors pull request');
return;
}
console.log(`Merging pull request: ${pr.html_url}`);
await github.rest.pulls.merge({
owner, repo,
pull_number: pr.number,
merge_method: "rebase",
});