From c955da7d925053f0a653267d55674e9335affa4b Mon Sep 17 00:00:00 2001 From: vigneshk-tw Date: Tue, 5 Nov 2024 09:50:53 +0530 Subject: [PATCH] feat: Trigger commitlint check only on PR --- .github/workflows/pr-health-check.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-health-check.yml b/.github/workflows/pr-health-check.yml index fd085f4f..052de982 100644 --- a/.github/workflows/pr-health-check.yml +++ b/.github/workflows/pr-health-check.yml @@ -32,6 +32,7 @@ jobs: run: npm ci - name: Run commitlint on PR commits + if: github.event_name == 'pull_request' run: | npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose @@ -91,7 +92,10 @@ jobs: owner: xero-internal workflow: pr.yml ref: refs/heads/master - workflow_inputs: '{"branch_name": "${{github.head_ref}}" }' + workflow_inputs: > + { + "branch_name": "${{ github.event_name == 'pull_request' && github.head_ref || 'master' }}" + } - name: Checking SDK health status uses: Codex-/await-remote-run@v1.12.2