File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Auto Merge Snyk Bot PRs
2+
3+ on :
4+ pull_request :
5+ types :
6+ - opened
7+ - synchronize
8+ - reopened
9+
10+ jobs :
11+ automerge :
12+ if : >
13+ github.actor == 'snyk-io[bot]' &&
14+ github.event.pull_request.head.repo.full_name == github.repository
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ' 20'
25+
26+ - name : Wait for all checks to pass
27+ uses : actions/github-script@v6
28+ with :
29+ script : |
30+ const pr = context.payload.pull_request;
31+ const checks = await github.checks.listForRef({
32+ owner: context.repo.owner,
33+ repo: context.repo.repo,
34+ ref: pr.head.sha,
35+ });
36+ if (checks.data.check_runs.some(check => check.conclusion !== 'success')) {
37+ core.setFailed('Not all checks have passed.');
38+ }
39+
40+ - name : Merge the pull request
41+ uses : actions/github-script@v6
42+ with :
43+ script : |
44+ await github.pulls.merge({
45+ owner: context.repo.owner,
46+ repo: context.repo.repo,
47+ pull_number: context.payload.pull_request.number,
48+ merge_method: 'squash',
49+ });
You can’t perform that action at this time.
0 commit comments