forked from elgohr/Github-Release-Action
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.35 KB
/
automerge.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
37
38
39
40
on:
pull_request_target:
branches: [ master ]
types: [ opened ]
jobs:
enableAutoMerge:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- uses: octokit/graphql-action@v2.x
id: get_pull_request_id
env:
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE }}
with:
query: |
query GetPullRequest($owner:String!,$repository:String!,$pull_request_number:Int!) {
repository(owner:$owner,name:$repository) {
pullRequest(number:$pull_request_number) {
id
}
}
}
owner: ${{ github.event.repository.owner.login }}
repository: ${{ github.event.repository.name }}
pull_request_number: ${{ github.event.pull_request.number }}
- uses: octokit/graphql-action@v2.x
id: automerge_pr
env:
GITHUB_TOKEN: ${{ secrets.AUTO_UPDATE }}
with:
query: |
mutation EnableAutomerge($pull_request_id:String!) {
addComment(input: {
subjectId: $pull_request_id,
body: "@dependabot merge"
}) {
__typename
}
}
pull_request_id: ${{ fromJson(steps.get_pull_request_id.outputs.data).repository.pullRequest.id }}