1- # This script seperate major and minor but we do merge them into the same branch.
2- # Having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline.
3- name : Auto-merge Dependabot PRs into collected branch
1+ # 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
45on :
56 pull_request :
7+ # synchronize
68 types : [opened, synchronize]
7- branches : [Automatic_version_update_dependabot] # Make sure this matches your actual branch name
8-
9+ branches : [automatic_version_update_dependabot] # make sure this matches your actual branch name
10+ check_suite :
11+ types : [completed]
12+ workflow_dispatch :
913permissions :
1014 contents : write
1115 pull-requests : write
16+ checks : read
1217
1318jobs :
19+ debug :
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : debug info
23+ 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+
29+ - name : delay for check
30+ run : |
31+ # drop later qqqq shouldnt need but its running before auto
32+ echo "waiting 4 minutes for other checks to start running..."
33+ sleep 240
34+
1435 auto-merge :
1536 runs-on : ubuntu-latest
16- if : github.actor == 'dependabot[bot]'
37+ # if dependabot and checks ran
38+ if : (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success')
1739 steps :
18- - name : Extract update type
40+ - name : extract update type
1941 id : extract
2042 run : |
21- PR_TITLE ="${{ github.event.pull_request.title }}"
22- if [[ $PR_TITLE == *"(major)"* ]]; then
23- echo "update_type=major" >> $GITHUB_OUTPUT
43+ pr_title ="${{ github.event.pull_request.title }}"
44+ if [[ $pr_title == *"(major)"* ]]; then
45+ echo "update_type=major" >> $github_output
2446 else
25- echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
47+ echo "update_type=minor_or_patch" >> $github_output
2648 fi
2749
28- - name : Auto -merge minor and patch updates
50+ - name : auto -merge minor and patch updates
2951 if : steps.extract.outputs.update_type == 'minor_or_patch'
30- run : gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
52+ # auto should set the the request to merge once checks complete
53+ # qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
54+ run : gh pr merge --auto 1
3155 env :
32- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ github_token : ${{ secrets.GITHUB_TOKEN }}
3357
34- - name : Auto -merge major updates
58+ - name : auto -merge major updates
3559 if : steps.extract.outputs.update_type == 'major'
36- run : gh pr merge --auto --squash "${{ github.event.pull_request.html_url }}"
60+ # auto should set the the request to merge once checks complete
61+ # qqqq could squash for cleaner? --squash "${{ github.event.pull_request.html_url }}"
62+ run : gh pr merge --auto 1
3763 env :
38- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments