Skip to content

Commit

Permalink
Build: [AEA-3605] - Clean up PR workflows (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
JackSpagnoliNHS authored Jan 26, 2024
1 parent 881f0fd commit 26a94da
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 102 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/pr_title_check.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,27 @@
name: PR Title Check

on:
# Will be null if PR title was not updated
workflow_call:
inputs:
PR_TITLE:
required: true
type: string

jobs:
pr_title_format_check:
runs-on: ubuntu-latest
steps:
- name: Set Up-to-date PR Title
run: |
if [[ "${{ inputs.PR_TITLE }}" ]]; then
echo "PR title was updated by dependabot prefixer."
echo "PR_TITLE=${{ inputs.PR_TITLE }}" >> $GITHUB_ENV
else
echo "PR title was not updated by dependabot prefixer."
echo "PR_TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
fi
- name: Check PR Title is Prefixed with Change Type
run: |
if [[ "${{ env.PR_TITLE }}" =~ ^(Fix|Update|New|Breaking|Docs|Build|Upgrade|Chore):.*$ ]]; then
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"
echo "See the contributing guide for more details:"
echo "https://github.com/NHSDigital/nhs-fhir-middy-error-handler/blob/main/CONTRIBUTING.md"
exit 1
fi
- name: Check PR Title contains Ticket/Dependabot Reference
run: |
if [[ "${{ env.PR_TITLE }}" =~ ^.*:.*\[(AEA-[0-9]{1,4}|dependabot)\].*-.*$ ]]; then
if [[ "${{ github.event.pull_request.title }}" =~ ^.*:.*\[([A-Z]+-[0-9]+|dependabot)\].*-.*$ ]]; then
echo "PR title contains ticket or dependabot reference."
else
echo "PR title does not contain ticket or dependabot reference."
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,12 @@ on:
branches: [main]

jobs:
dependabot_prefix_title:
uses: ./.github/workflows/rename_dependabot_prs.yml

quality_checks:
needs: dependabot_prefix_title
uses: ./.github/workflows/quality_checks.yml
with:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

pr_title_format_check:
needs: dependabot_prefix_title
uses: ./.github/workflows/pr_title_check.yml
with:
# Will be null if PR title was not updated
PR_TITLE: ${{ needs.dependabot_prefix_title.outputs.updated_pr_title }}
2 changes: 1 addition & 1 deletion .github/workflows/quality_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
required: true

jobs:
quality_checks:
lint_build_test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
68 changes: 0 additions & 68 deletions .github/workflows/rename_dependabot_prs.yml

This file was deleted.

10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"semantic-release": "^23.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.4.0",
"typescript": "^5.3.3"
"typescript": "^4.4.3"
},
"dependencies": {
"@aws-lambda-powertools/logger": "^1.17.0",
Expand Down

0 comments on commit 26a94da

Please sign in to comment.