11# qqqq in development
2- # This script seperate major and minor but we do merge them into the same branch.
3- # Having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
4- name : Auto -merge Dependabot PRs into collected branch
2+ # this script seperate major and minor but we do merge them into the same branch.
3+ # having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
4+ name : auto -merge dependabot prs into collected branch
55on :
66 pull_request :
77 # synchronize
88 types : [opened, synchronize]
9- branches : [Automatic_version_update_dependabot ] # Make sure this matches your actual branch name
9+ branches : [automatic_version_update_dependabot ] # make sure this matches your actual branch name
1010 check_suite :
1111 types : [completed]
1212 workflow_dispatch :
@@ -19,43 +19,45 @@ jobs:
1919 debug :
2020 runs-on : ubuntu-latest
2121 steps :
22- - name : Debug info
22+ - name : debug info
2323 run : |
24- echo "Actor : ${{ github.actor }}"
25- echo "PR Title : ${{ github.event.pull_request.title }}"
26- echo "Target Branch : ${{ github.event.pull_request.base.ref }}"
27- echo "Source Branch : ${{ github.event.pull_request.head.ref }}"
28- - name: Wait for other checks to start
29- - name : Delay for check
24+ echo "actor : ${{ github.actor }}"
25+ echo "pr title : ${{ github.event.pull_request.title }}"
26+ echo "target branch : ${{ github.event.pull_request.base.ref }}"
27+ echo "source branch : ${{ github.event.pull_request.head.ref }}"
28+ - name: wait for other checks to start
29+ - name : delay for check
3030 run : |
3131 # drop later qqqq shouldnt need but its running before auto
32- echo "Waiting 4 minutes for other checks to start running..."
32+ echo "waiting 4 minutes for other checks to start running..."
3333 sleep 240
3434 auto-merge :
3535 runs-on : ubuntu-latest
3636 # if dependabot and checks ran
3737 if : (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')
3838 steps :
39- - name : Extract update type
39+ - name : extract update type
4040 id : extract
4141 run : |
42- PR_TITLE ="${{ github.event.pull_request.title }}"
43- if [[ $PR_TITLE == *"(major)"* ]]; then
44- echo "update_type=major" >> $GITHUB_OUTPUT
42+ pr_title ="${{ github.event.pull_request.title }}"
43+ if [[ $pr_title == *"(major)"* ]]; then
44+ echo "update_type=major" >> $github_output
4545 else
46- echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
46+ echo "update_type=minor_or_patch" >> $github_output
4747 fi
4848
49- - name : Auto -merge minor and patch updates
49+ - name : auto -merge minor and patch updates
5050 if : steps.extract.outputs.update_type == 'minor_or_patch'
51- # Auto should set the the request to merge once checks complete
52- run : gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
51+ # auto should set the the request to merge once checks complete
52+ # qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
53+ run : gh pr merge --auto 1
5354 env :
54- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55+ github_token : ${{ secrets.GITHUB_TOKEN }}
5556
56- - name : Auto -merge major updates
57+ - name : auto -merge major updates
5758 if : steps.extract.outputs.update_type == 'major'
58- # Auto should set the the request to merge once checks complete
59- run : gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
59+ # auto should set the the request to merge once checks complete
60+ # qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
61+ run : gh pr merge --auto 1
6062 env :
61- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments