generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
f2d9673
commit 284d92b
Showing
3 changed files
with
36 additions
and
28 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,30 @@ | ||
name: Quality Checks | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
pr_title_format_check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check PR Title is Prefixed with Change Type | ||
run: | | ||
if [[ "${{ github.event.pull_request.title }}" =~ ^(Fix|Update|New|Breaking|Docs|Build|Upgrade|Chore):.*$ ]]; then | ||
echo "PR title is prefixed with change type." | ||
else | ||
echo "PR title is not prefixed with change type." | ||
echo "Please prefix your PR title with a change type (Fix, Update, New, Breaking, Docs, Build, Upgrade, Chore)." | ||
echo "See the ESLint commit convention for more details:" | ||
echo "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint" | ||
exit 1 | ||
fi | ||
- name: Check PR Title contains Ticket/Dependabot Reference | ||
run: | | ||
if [[ "${{ github.event.pull_request.title }}" =~ ^.*:.*\[(AEA-[0-9]{4}|dependabot)\].*-.*$ ]]; then | ||
echo "PR title contains ticket or dependabot reference." | ||
else | ||
echo "PR title does not contain ticket or dependabot reference." | ||
echo "Please ensure PR title contains a ticket (eg. 'Fix: [AEA-####] - ...', or 'Chore: [dependabot] - ...')." | ||
exit 1 | ||
fi |
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
name: Dependabot PR Title Prefix | ||
name: Dependabot Prefix PR Title | ||
|
||
on: | ||
workflow_call: | ||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
update-pr-title: | ||
prefix-pr-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if PR is from Dependabot | ||
|
@@ -19,7 +19,7 @@ jobs: | |
echo "No change to PR title." | ||
fi | ||
- name: Update PR title | ||
- name: Update PR title with Prefix | ||
if: env.PR_TITLE | ||
uses: actions/[email protected] | ||
with: | ||
|