From 38a601c72bc82836a7f6ff2f544d98a14605fb56 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Wed, 21 Jun 2023 09:22:52 +0200 Subject: [PATCH] ci: Rename commitlint to PR title Lint, echo PR titles from env var Signed-off-by: Sergei Petrosian --- .github/workflows/{commitlint.yml => pr-title-lint.yml} | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) rename .github/workflows/{commitlint.yml => pr-title-lint.yml} (70%) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/pr-title-lint.yml similarity index 70% rename from .github/workflows/commitlint.yml rename to .github/workflows/pr-title-lint.yml index ae3e73e..19d8e7d 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/pr-title-lint.yml @@ -1,4 +1,4 @@ -name: Commitlint +name: PR Title Lint on: # yamllint disable-line rule:truthy pull_request: types: @@ -25,6 +25,7 @@ jobs: run: npm install @commitlint/config-conventional @commitlint/cli - name: Run commitlint on PR title - run: >- - echo '${{ github.event.pull_request.title }}' | - npx commitlint --verbose + env: + PR_TITLE: ${{ github.event.pull_request.title }} + # Echo from env variable to avoid bash errors with extra characters + run: echo "$PR_TITLE" | npx commitlint --verbose