From 9208e2179d4191e131ae66d69139c3ed13236b76 Mon Sep 17 00:00:00 2001 From: Tony Novak Date: Wed, 31 Dec 2025 10:58:11 -0500 Subject: [PATCH] feat: run linters and tests on each push, not just on open PRs --- ...r-validation.yml => commit-validation.yml} | 22 +++++++++---------- cicd.md | 6 ++--- 2 files changed, 13 insertions(+), 15 deletions(-) rename .github/workflows/{pr-validation.yml => commit-validation.yml} (90%) diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/commit-validation.yml similarity index 90% rename from .github/workflows/pr-validation.yml rename to .github/workflows/commit-validation.yml index 0315a20d6..e98849b9a 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/commit-validation.yml @@ -1,15 +1,13 @@ -name: PR Validation [auto] +name: Commit Validation [auto] permissions: contents: read -on: - pull_request: - branches: [main, 'release/**'] +on: push concurrency: - group: pr-${{ github.event.pull_request.number }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: validate-commits: @@ -18,7 +16,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }} - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # Pinned commit hash for @v4 @@ -44,17 +42,17 @@ jobs: - name: Validate commits run: | - BASE=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) + BASE=$(git merge-base ${{ github.sha }} ${{ github.sha }}) pnpx commitlint \ --from "$BASE" \ - --to ${{ github.event.pull_request.head.sha }} + --to ${{ github.sha }} run-unit-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }} - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # Pinned commit hash for @v4 @@ -96,7 +94,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }} - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # Pinned commit hash for @v4 @@ -161,7 +159,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.sha }} - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # Pinned commit hash for @v4 diff --git a/cicd.md b/cicd.md index 86da31030..7719f6237 100644 --- a/cicd.md +++ b/cicd.md @@ -31,9 +31,9 @@ main (next) → stable (latest) → X.x (maintenance) ### Core Workflows -#### 1. PR Validation (`pr-validation.yml`) +#### 1. Commit Validation (`commit-validation.yml`) -**Triggers**: All pull requests +**Triggers**: All pushes **Checks**: @@ -44,7 +44,7 @@ main (next) → stable (latest) → X.x (maintenance) - Visual regression tests - E2E tests (main branch only) -**Required to pass before merge**. +**Required to pass before PR merge**. #### 2. Release (`release.yml`)