Skip to content

Commit 5c93310

Browse files
committed
ci(workflows): add auto-merge
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 7b665ee commit 5c93310

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

.github/workflows/auto-merge.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Pull request auto-merge
2+
#
3+
# Automatically merge pull requests after requirements are met.
4+
#
5+
# References:
6+
#
7+
# - https://cli.github.com/manual/gh_pr_merge
8+
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#pull_request
9+
# - https://docs.github.com/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository
10+
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
11+
# - https://github.com/actions/checkout
12+
# - https://github.com/hmarr/debug-action
13+
14+
---
15+
name: auto-merge
16+
on:
17+
pull_request:
18+
types:
19+
- opened
20+
- synchronize
21+
jobs:
22+
auto-merge:
23+
if: github.event.pull_request.auto_merge == null && github.event.pull_request.draft == false
24+
runs-on: ubuntu-latest
25+
steps:
26+
- id: debug
27+
name: Print environment variables and event payload
28+
uses: hmarr/debug-action@v2.1.0
29+
- id: checkout
30+
name: Checkout ${{ github.head_ref }}
31+
uses: actions/checkout@v3.3.0
32+
with:
33+
ref: ${{ github.head_ref }}
34+
- id: auto-merge
35+
name: Enable auto-merge
36+
run: gh pr merge ${{ github.event.pull_request.number }} --auto --squash
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.PAT_REPO }}

.github/workflows/dependabot-auto.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ jobs:
4444
persist-credentials: ${{ steps.metadata.outputs.package-ecosystem == 'npm_and_yarn' }}
4545
ref: ${{ github.head_ref }}
4646
token: ${{ env.GITHUB_TOKEN }}
47-
- id: enable-auto-merge
48-
name: Enable auto-merge
49-
run: gh pr merge ${{ github.event.number }} --auto --squash
5047
- id: gpg-import
5148
name: Import GPG key
5249
if: steps.metadata.outputs.package-ecosystem == 'npm_and_yarn'

0 commit comments

Comments
 (0)