-
Notifications
You must be signed in to change notification settings - Fork 350
26 lines (26 loc) · 1.05 KB
/
enable-auto-merge.yml
File metadata and controls
26 lines (26 loc) · 1.05 KB
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
name: Enable auto merge
on:
pull_request_target:
types: [opened, ready_for_review]
permissions:
contents: write
pull-requests: write
jobs:
add_milestone:
runs-on: ubuntu-latest
if: ${{ github.repository == 'microsoft/vstest' && github.event.pull_request.user.login == 'dotnet-maestro[bot]' && (startsWith(github.event.pull_request.title, '[main] Source code updates from dotnet/') || startsWith(github.event.pull_request.title, '[main] Update dependencies from dotnet/') || startsWith(github.event.pull_request.title, '[main] Update dependencies from devdiv/')) }}
steps:
- name: Enable pull request auto-merge
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
run: |
gh api graphql -f query='
mutation($pull: ID!) {
enablePullRequestAutoMerge(input: {pullRequestId: $pull, mergeMethod: SQUASH}) {
pullRequest {
id
number
}
}
}' -f pull=$PULL_REQUEST_ID