Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: [AEA-3605] - Clean up PR workflows #25

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading