From 1b2013d2a39850ddc46525542db368098967d2de Mon Sep 17 00:00:00 2001 From: Simonas <20096648+simjak@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:05:33 +0200 Subject: [PATCH] fix: conventional commits for PR titles --- .github/workflows/conventional_commits.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/conventional_commits.yml b/.github/workflows/conventional_commits.yml index 7db4b720..02939fc7 100644 --- a/.github/workflows/conventional_commits.yml +++ b/.github/workflows/conventional_commits.yml @@ -15,11 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Validate - uses: CondeNast/conventional-pull-request-action@v0.2.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - commitlintRulesPath: "./commitlint.config.js" - commitTitleMatch: "false" - ignoreCommits: "false" + - name: Install commitlint + run: | + npm install @commitlint/cli @commitlint/config-conventional + - name: Fetch merge commit message + id: merge_commit + run: | + MERGE_COMMIT_MESSAGE=$(git log --merges -n 1 --pretty=format:"%s") + echo "::set-output name=message::$MERGE_COMMIT_MESSAGE" + - name: Validate merge commit message + run: | + echo "${{ steps.merge_commit.outputs.message }}" | npx commitlint