File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 "description" : " Base rule - packageFileDir and depName separation" ,
2222 "matchPaths" : [" **" ],
2323 "automerge" : true ,
24- "groupName" : " {{packageFileDir}} {{depName}}"
24+ "groupName" : " {{packageFileDir}} {{depName}}" ,
25+ "addLabels" : [" 🤖 automerge" ]
2526 },
2627
2728 {
Original file line number Diff line number Diff line change 1313 runs-on : ubuntu-latest
1414 if : github.actor == 'renovate[bot]'
1515 steps :
16- - name : Checkout
17- uses : actions/checkout@v4
18-
1916 - name : Auto-approve and Merge
2017 uses : ./auto-approve
2118 with :
2219 app-id : ${{ vars.APP_ID }}
2320 private-key : ${{ secrets.APP_PRIVATE_KEY }}
21+ auto-merge-label : ' 🤖 automerge'
Original file line number Diff line number Diff line change 77 private-key :
88 description : ' GitHub App private key'
99 required : true
10+ auto-merge-label :
11+ description : ' Label required for auto-merge. If empty, all PRs are merged.'
12+ required : false
13+ default : ' '
1014
1115runs :
1216 using : ' composite'
2630 - name : Auto-merge PRs
2731 continue-on-error : true
2832 shell : bash
29- run : gh pr merge --squash --auto "$PR_URL"
33+ run : |
34+ TARGET_LABEL="${{ inputs.auto-merge-label }}"
35+
36+ if [[ -n "$TARGET_LABEL" ]]; then
37+ echo "Checking for label: $TARGET_LABEL"
38+ CURRENT_LABELS=$(gh pr view "$PR_URL" --json labels --jq '.labels[].name')
39+ if ! echo "$CURRENT_LABELS" | grep -Fqx "$TARGET_LABEL"; then
40+ echo "::notice::Skipping auto-merge because label '$TARGET_LABEL' is missing."
41+ exit 0
42+ fi
43+ echo "Label '$TARGET_LABEL' found."
44+ fi
45+
46+ echo "Proceeding with auto-merge..."
47+ gh pr merge --squash --auto "$PR_URL"
3048 env :
3149 PR_URL : ${{ github.event.pull_request.html_url }}
3250 GH_TOKEN : ${{ steps.app-token.outputs.token }}
You can’t perform that action at this time.
0 commit comments