Skip to content

Commit

Permalink
reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
JackSpagnoliNHS committed Jan 23, 2024
1 parent f2d9673 commit 284d92b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 28 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pr_title_check.yml
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
28 changes: 3 additions & 25 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [main]

jobs:
dependabot_title_prefix:
dependabot_prefix_title:
uses: ./.github/workflows/rename-dependabot-prs.yml

quality_checks:
Expand All @@ -16,27 +16,5 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

pr_title_format_check:
needs: dependabot_title_prefix
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
needs: dependabot_prefix_title
uses: ./.github/workflows/pr_title_check.yml
6 changes: 3 additions & 3 deletions .github/workflows/rename-dependabot-prs.yml
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
Expand All @@ -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:
Expand Down

0 comments on commit 284d92b

Please sign in to comment.