-
Notifications
You must be signed in to change notification settings - Fork 10
47 lines (40 loc) · 1.66 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Auto merge
# both actions get started on PR create/update
# approve gets done right away
# merge sleeps and retries until CI finishes successfully up to 25 minutes
# not ideal, much better would be to trigger merge later, exactly whenever CI finishes. But couldn't make make it work.
# Trigger the workflow on pull request
on:
pull_request_target:
types:
- synchronize
- opened
jobs:
autoapprove:
name: Approve
runs-on: ubuntu-latest
steps:
- name: Auto approve
uses: hmarr/auto-approve-action@v4 # Custom action for auto approval already available on marketplace
# Perform the auto approve action only when the PR is raised by dependabot
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
with:
# Create a personal access token and store it under the Secrets section of the particular repository
# with the key "GITHUB_ACTIONS_TOKEN"
github-token: ${{ secrets.FLOWCRYPT_ROBOT_ACCESS_TOKEN }}
automerge:
name: Enable automerge on dependabot PRs
runs-on: ubuntu-latest
steps:
- name: Enable automerge on dependabot PRs
uses: daneden/enable-automerge-action@v1
with:
# A personal access token that you have generated and saved in the
# repo or org’s encrypted secrets
github-token: ${{ secrets.FLOWCRYPT_ROBOT_ACCESS_TOKEN }}
# The name of the PR author to enable automerge for
# Defaults to dependabot[bot]
allowed-author: "dependabot[bot]"
# Allowed values: MERGE | SQUASH | REBASE
# Defaults to MERGE
merge-method: SQUASH