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
4
5
on :
5
6
pull_request :
7
+ # synchronize
6
8
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 :
9
13
permissions :
10
14
contents : write
11
15
pull-requests : write
16
+ checks : read
12
17
13
18
jobs :
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
+
14
35
auto-merge :
15
36
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')
17
39
steps :
18
- - name : Extract update type
40
+ - name : extract update type
19
41
id : extract
20
42
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
24
46
else
25
- echo "update_type=minor_or_patch" >> $GITHUB_OUTPUT
47
+ echo "update_type=minor_or_patch" >> $github_output
26
48
fi
27
49
28
- - name : Auto -merge minor and patch updates
50
+ - name : auto -merge minor and patch updates
29
51
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
31
55
env :
32
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56
+ github_token : ${{ secrets.GITHUB_TOKEN }}
33
57
34
- - name : Auto -merge major updates
58
+ - name : auto -merge major updates
35
59
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
37
63
env :
38
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
64
+ github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments