-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (28 loc) · 991 Bytes
/
auto-merge.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
# SPDX-FileCopyrightText: Andrew Hayzen <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
name: auto merge
on:
pull_request_target:
workflow_dispatch:
permissions:
pull-requests: write
contents: write
jobs:
auto-merge:
runs-on: ubuntu-22.04
# Auto merge if this is
# - dependabot
# - update of flake.lock
if: "${{ github.event.pull_request.user.login == 'dependabot[bot]' || (github.event.pull_request.user.login == 'ahayzen-nix-config-bot[bot]' && github.event.pull_request.title == 'chore: update flake.lock') }}"
steps:
- name: approve the pr
run: gh pr review $PR_URL --approve
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: auto-merge the pr
run: gh pr merge --auto --delete-branch --rebase "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}