From d23eed614473f76105861baf3848d7e720c49395 Mon Sep 17 00:00:00 2001 From: Adam Yeats Date: Wed, 27 Nov 2024 17:31:47 +0000 Subject: [PATCH] Add GH action to check PR title --- .github/workflows/commitlint.yml | 26 ++++++++++++++++++++++++++ .husky/commit-msg | 1 - 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/commitlint.yml delete mode 100644 .husky/commit-msg diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..ef661d1 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,26 @@ +name: Commitlint + +on: + pull_request: + branches: + - main + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js environment + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Lint PR title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: yarn commitlint --edit "$PR_TITLE" diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index 70bd3dd..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -npx --no-install commitlint --edit "$1"