Skip to content

Commit c56e60c

Browse files
committed
Support GitHub auto merge with use-auto-merge option
1 parent 76a7466 commit c56e60c

File tree

7 files changed

+1059
-84
lines changed

7 files changed

+1059
-84
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ Note that the action does not check the lockfile is valid, so you should only se
88

99
It currently supports npm and yarn.
1010

11+
By default this action will poll the API and wait for all status checks to pass which is not very efficient. It's recommended that you:
12+
13+
- Enable auto merge on your repo
14+
- Enable the `use-auto-merge` option in the action
15+
- Configure this action as a required status check
16+
- This is so that if a PR is updated and auto merge needs disabling, the PR cannot auto merge before that happens
17+
1118
## Config
1219

20+
- `use-auto-merge`: **\[Recommended\]** Enable GitHub auto merge on the PR and exit instead of waiting for the checks to complete and merging. Auto merge must be enabled on the repo, and you should make sure this is a required status check. _Default: `false`_
1321
- `allowed-actors`: A comma separated list of usernames auto merge is allowed for.
1422
- `repo-token` (optional): a GitHub API token. _Default: The token provided to the workflow (`${{ github.token }}`)_
1523
- `allowed-update-types` (optional): A comma separated list of types of updates that are allowed. Supported: [devDependencies|dependencies]:[major|minor|patch|premajor|preminor|prerelease]. _Default: `devDependencies:minor, devDependencies:patch`_
@@ -34,13 +42,14 @@ on:
3442
- pull_request_target
3543

3644
jobs:
37-
run:
45+
auto-merge-dependency-updates:
3846
runs-on: ubuntu-latest
3947
permissions:
4048
contents: write
4149
pull-requests: write
4250
steps:
4351
- uses: tjenkinson/gh-action-auto-merge-dependency-updates@v1
4452
with:
53+
use-auto-merge: true
4554
allowed-actors: dependabot-preview[bot], dependabot[bot]
4655
```

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ inputs:
1414
approve:
1515
description: 'Automatically approve the PR if it qualifies for auto merge'
1616
default: 'true'
17+
use-auto-merge:
18+
description: 'Enable GitHub auto merge on the PR and exit instead of waiting for the checks to complete and merging. Auto merge must be enabled on the repo, and you should make sure this is a required status check'
19+
default: 'false'
1720
merge:
1821
description: 'Merge the PR if it qualifies'
1922
default: 'true'

0 commit comments

Comments
 (0)