-
-
Notifications
You must be signed in to change notification settings - Fork 41
36 lines (33 loc) · 1001 Bytes
/
dependabot.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
35
36
name: dependabot-auto-merge
on:
pull_request:
types:
- opened
- reopened
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code 👋
uses: actions/checkout@v4
- name: Check and merge ⛙
uses: actions/github-script@v7
with:
github-token: ${{ secrets.QWY_SYNC_BOT_TOKEN }}
script: |
const { repo: { owner, repo } } = context;
const pr = context.payload.pull_request;
if (pr.user.login !== 'dependabot[bot]') {
console.log('Not Dependabot pull request');
return;
}
console.log(`Merging pull request: ${pr.html_url}`);
await github.rest.pulls.merge({
owner, repo,
pull_number: pr.number,
merge_method: "squash",
});
await github.rest.git.deleteRef({
owner,
repo,
ref: `heads/${pr.head.ref}`,