-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 1.1 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
# This workflow is automatically distributed from the following repository:
# https://github.com/legnoh/github-repo-configs/blob/main/modules/repo/templates/.github/workflows/automerge.yml.tftpl
name: Merge Dependencies
on:
pull_request_target:
branches: [main]
jobs:
auto-merge:
runs-on: ubuntu-latest
if: |
github.event.pull_request.user.login == 'dependabot[bot]' ||
github.event.pull_request.user.login == 'legnoh-bump-bot[bot]'
steps:
- name: Create bump-bot Token
id: github-app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.G_BUMP_BOT_ID }}
private-key: ${{ secrets.G_BUMP_BOT_PRIVATEKEY }}
- name: Enable auto-merge on PR
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ steps.github-app.outputs.token }}
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ steps.github-app.outputs.token }}