You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-14Lines changed: 26 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,14 @@ Inspired by [Merge Queue feature of Mergify](https://mergify.io/features/merge-q
14
14
15
15
## Quick Start
16
16
17
-
1. Enable `Allow auto-merge` in `Settings/Options`.
18
-
19
-
2. (Optional) Create a branch protection rule in `Settings/Branches`.
20
-
21
-
Support checks:
17
+
> This action only has effect if you enabled `Settings/Branches/YourBranchProtectionRule/Require status checks to pass before merging/Require branches to be up to date before merging`.
22
18
23
-
-`Require approvals`
24
-
-`Status checks that are required`
25
-
26
-
This feature requires personal access token that has enough permission.
19
+
1. Enable `Allow auto-merge` in `Settings/Options`.
27
20
28
21
3. Create a workflow file (`.github/workflow/update-branch.yaml`):
29
22
23
+
Example:
24
+
30
25
```yaml
31
26
name: Update branch
32
27
@@ -54,15 +49,32 @@ jobs:
54
49
token: ${{ secrets.GITHUB_TOKEN }}
55
50
# One of MERGE, SQUASH, REBASE (default: MERGE)
56
51
autoMergeMethod: SQUASH
57
-
# Required at least 2 approves (default: 0)
58
-
requiredApprovals: 2
59
52
# Ignore pull requests without these labels
60
53
requiredLabels: auto-merge
54
+
# Required at least 2 approves (default: 0)
55
+
requiredApprovals: 2
61
56
# Required these status checks success
62
57
requiredStatusChecks: |
63
58
build_pr
64
59
WIP
65
-
# Optional branch name pattern instead of main or master
66
-
# Status checks will be used
67
-
# protectedBranchNamePattern: trunk
60
+
```
61
+
62
+
If you are using a personal access token and it has permission to access branch protection rules, you can set your jobs like:
63
+
64
+
```yaml
65
+
jobs:
66
+
update-branch:
67
+
runs-on: ubuntu-latest
68
+
steps:
69
+
- uses: lcdsmao/update-branch@v3
70
+
with:
71
+
# Personal access token
72
+
token: ${{ secrets.MY_PAT }}
73
+
# One of MERGE, SQUASH, REBASE (default: MERGE)
74
+
autoMergeMethod: SQUASH
75
+
# Ignore pull requests without these labels
76
+
requiredLabels: auto-merge
77
+
# `Status checks` and `Require approvals` settings will be used
78
+
# Or ignore this key then the action will automatically find main or master branch protection rule
0 commit comments