From 7cb57aec320a1b2f781346dd7416c766b3dc0e64 Mon Sep 17 00:00:00 2001 From: Ryan Butler Date: Thu, 19 Dec 2024 16:57:27 -0500 Subject: [PATCH] feat(ci): enforce conventional commits (#334) --- .github/workflows/pr-compliance.yaml | 30 +++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pr-compliance.yaml b/.github/workflows/pr-compliance.yaml index f2dac316..788c8b75 100644 --- a/.github/workflows/pr-compliance.yaml +++ b/.github/workflows/pr-compliance.yaml @@ -1,27 +1,21 @@ name: Pull-Request Compliance + on: pull_request: - types: [opened, edited, closed, reopened, synchronize] + types: + - opened + - edited + - synchronize + - reopened + +permissions: + pull-requests: read jobs: check-pr-title: name: Check PR title runs-on: ubuntu-24.04 - # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - env: - TITLE: ${{ github.event.pull_request.title }} steps: - - name: Check title format - run: | - # has a colon which separates the area from the description - # max 72 characters - exit_code=0 - if [[ ! ${TITLE} =~ ^[^:]+:.+$ ]]; then - echo "PR title must specify an area and a description, see README.md" - exit_code=1 - fi - if [[ ${#TITLE} -gt 72 ]]; then - echo "PR title is too long, see README.md" - exit_code=1 - fi - exit $exit_code + - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # pin@v5.5.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}