Skip to content

Commit

Permalink
Add a workflow to enable automerge for PRs
Browse files Browse the repository at this point in the history
garyttierney committed Mar 3, 2024
1 parent 6a37a12 commit df3f4b2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on: pull_request_target
jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: octokit/graphql-action@v2.x
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
id: enable_automerge
with:
query: |
mutation enableAutoMerge($pullId: ID!) {
enablePullRequestAutoMerge(input: {
pullRequestId: $pullId,
mergeMethod: MERGE,
}) {
pullRequest {
id,
autoMergeRequest {
enabledAt
}
}
}
}
variables: |
pullId: ${{ github.event.pull_request.node_id }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit df3f4b2

Please sign in to comment.