From eca21284a42af751956634d38a7b25208a044f53 Mon Sep 17 00:00:00 2001 From: vigneshk-tw Date: Tue, 5 Nov 2024 09:53:44 +0530 Subject: [PATCH 1/3] 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 From e949a3feff1e9e65e3771e9637085f4eaa994fed Mon Sep 17 00:00:00 2001 From: vigneshk-tw Date: Tue, 5 Nov 2024 10:01:26 +0530 Subject: [PATCH 2/3] feat: testing commit to trigger on local branch --- .github/workflows/pr-health-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-health-check.yml b/.github/workflows/pr-health-check.yml index 052de982..24e57d06 100644 --- a/.github/workflows/pr-health-check.yml +++ b/.github/workflows/pr-health-check.yml @@ -8,6 +8,7 @@ on: push: branches: - master + - fix/trigger-commitlint-on-pr-1 jobs: pr-health-check: From 52940238ff8b44d1416df14544ad35df4731d241 Mon Sep 17 00:00:00 2001 From: vigneshk-tw Date: Tue, 5 Nov 2024 10:04:46 +0530 Subject: [PATCH 3/3] feat: revert testing commit to trigger on local branch --- .github/workflows/pr-health-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr-health-check.yml b/.github/workflows/pr-health-check.yml index 24e57d06..052de982 100644 --- a/.github/workflows/pr-health-check.yml +++ b/.github/workflows/pr-health-check.yml @@ -8,7 +8,6 @@ on: push: branches: - master - - fix/trigger-commitlint-on-pr-1 jobs: pr-health-check: