-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Greg O'Grady
committed
Nov 11, 2024
1 parent
57eac46
commit b560ac7
Showing
1 changed file
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: 'Update Pull Request Title' | ||
on: | ||
pull_request: | ||
types: [opened, edited, 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" |