From bc5fab4e08aa0b7f1d5a9de12e5f651303c85c41 Mon Sep 17 00:00:00 2001 From: Kush Upadhyay Date: Mon, 25 Nov 2024 07:31:22 +0000 Subject: [PATCH] ci: use intermediate env vars for commitlint job Signed-off-by: Kush Upadhyay --- .github/workflows/commitlint.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 5d62c44..c02c3d5 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -19,10 +19,14 @@ jobs: - name: Install dependencies run: npm install commitlint @commitlint/config-conventional - name: Run commitlint against commits in PR + env: + WORKSPACE: ${{ github.workspace }} + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} run: | npx commitlint \ - -g ${{ github.workspace }}/.commitlint.config.mjs \ - --from ${{ github.event.pull_request.base.sha }} \ - --to ${{ github.event.pull_request.head.sha }} \ - --help-url="https://github.com/${GITHUB_REPOSITORY}/blob/${GITHUB_BASE_REF}/CONTRIBUTING.md" \ + -g "$WORKSPACE"/.commitlint.config.mjs \ + --from "$BASE_SHA" \ + --to "$HEAD_SHA" \ + --help-url="https://github.com/"${GITHUB_REPOSITORY}"/blob/"${GITHUB_BASE_REF}"/CONTRIBUTING.md" \ --verbose