-
Notifications
You must be signed in to change notification settings - Fork 97
78 lines (72 loc) · 2.5 KB
/
update-pr-title.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: 'Update Pull Request Title'
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
jobs:
update_pr_title:
runs-on: ubuntu-latest
steps:
- name: Get branch name
if: ${{ github.actor != 'github-actions' }}
id: branch-name
uses: tj-actions/branch-names@v6
- name: Check for hotfix label
uses: Dreamcodeio/[email protected]
id: hotfixLabel
with:
label: hotfix
- name: Check for breakglass label
uses: Dreamcodeio/[email protected]
id: breakglassLabel
with:
label: breakglass
- uses: tzkhan/pr-update-action@v2
if: |
github.actor != 'github-actions'
&& !contains(github.event.pull_request.title, '[breakglass]')
&& (
contains(steps.branch-name.outputs.head_ref_branch, 'break-glass')
|| contains(steps.branch-name.outputs.head_ref_branch, 'breakglass')
|| steps.breakglassLabel.outputs.hasLabel == 'true'
)
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
head-branch-regex: '.+'
title-template: ' [breakglass]'
title-update-action: suffix
- uses: tzkhan/pr-update-action@v2
if: |
github.actor != 'github-actions'
&& !contains(github.event.pull_request.title, '[bugfix]')
&& (
contains(steps.branch-name.outputs.head_ref_branch, 'bug-fix')
|| contains(steps.branch-name.outputs.head_ref_branch, 'bugfix')
|| steps.hotfixLabel.outputs.hasLabel == 'true'
)
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
head-branch-regex: '.+'
title-template: ' [bugfix]'
title-update-action: suffix
breakglass:
needs: update_pr_title
name: Breakglass
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
permissions:
contents: write
pull-requests: write
steps:
- id: automerge
name: automerge
uses: 'pascalgn/[email protected]'
env:
GITHUB_TOKEN: '${{ secrets.GH_SA_TOKEN }}'
MERGE_LABELS: 'breakglass'
MERGE_METHOD: 'squash'
MERGE_DELETE_BRANCH: 'true'
MERGE_REQUIRED_APPROVALS: '0'
MERGE_RETRY_SLEEP: '60000' # ms
MERGE_RETRIES: '15'
MERGE_READY_STATE: 'clean,unstable'
MERGE_COMMIT_MESSAGE_REGEX: '(.*)### Implementation details. How do you make this change'