From d0f3c11515222a95b8d93ac1d6277f3a5bf4e166 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 8 Sep 2026 15:01:05 +0100 Subject: [PATCH 1/2] ci: separate PR title validation from build jobs --- .github/workflows/ci.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 768fdad..1520330 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,11 +8,13 @@ on: types: [opened, edited, synchronize, reopened] jobs: - test: + pr-title: + if: >- + github.event_name == 'pull_request' && + (github.event.action != 'edited' || github.event.changes.title != null) runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - name: Validate Conventional Commit title - if: github.event_name == 'pull_request' env: PR_TITLE: ${{ github.event.pull_request.title }} shell: bash @@ -23,6 +25,11 @@ jobs: echo "Examples: feat: add a feature, fix(api): correct behavior, feat!: break compatibility" >&2 exit 1 fi + + test: + if: github.event_name != 'pull_request' || github.event.action != 'edited' + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: - uses: useblacksmith/checkout@v1 - uses: dtolnay/rust-toolchain@master with: @@ -34,6 +41,7 @@ jobs: - run: cargo test --locked macos-rust: + if: github.event_name != 'pull_request' || github.event.action != 'edited' runs-on: blacksmith-6vcpu-macos-15 steps: - uses: useblacksmith/checkout@v1 @@ -57,6 +65,7 @@ jobs: retention-days: 1 macos-desktop: + if: github.event_name != 'pull_request' || github.event.action != 'edited' needs: macos-rust runs-on: blacksmith-6vcpu-macos-15 steps: From c266f1bf039a0745b3c10ed091cb77e46c93fa09 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 8 Sep 2026 16:20:25 +0100 Subject: [PATCH 2/2] fix(ci): preserve required checks across PR edits --- .github/workflows/ci.yml | 23 +---------------------- .github/workflows/pr-title.yml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/pr-title.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1520330..ca82506 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,29 +5,10 @@ on: branches: - main pull_request: - types: [opened, edited, synchronize, reopened] + types: [opened, synchronize, reopened] jobs: - pr-title: - if: >- - github.event_name == 'pull_request' && - (github.event.action != 'edited' || github.event.changes.title != null) - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - name: Validate Conventional Commit title - env: - PR_TITLE: ${{ github.event.pull_request.title }} - shell: bash - run: | - pattern='^[a-z][a-z0-9-]*(\([^()]+\))?(!)?: .+' - if [[ ! $PR_TITLE =~ $pattern ]]; then - echo "Pull request titles must use Conventional Commit syntax." >&2 - echo "Examples: feat: add a feature, fix(api): correct behavior, feat!: break compatibility" >&2 - exit 1 - fi - test: - if: github.event_name != 'pull_request' || github.event.action != 'edited' runs-on: blacksmith-4vcpu-ubuntu-2404 steps: - uses: useblacksmith/checkout@v1 @@ -41,7 +22,6 @@ jobs: - run: cargo test --locked macos-rust: - if: github.event_name != 'pull_request' || github.event.action != 'edited' runs-on: blacksmith-6vcpu-macos-15 steps: - uses: useblacksmith/checkout@v1 @@ -65,7 +45,6 @@ jobs: retention-days: 1 macos-desktop: - if: github.event_name != 'pull_request' || github.event.action != 'edited' needs: macos-rust runs-on: blacksmith-6vcpu-macos-15 steps: diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..b463fa5 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,21 @@ +name: pr-title + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + runs-on: blacksmith-4vcpu-ubuntu-2404 + steps: + - name: Validate Conventional Commit title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + shell: bash + run: | + pattern='^[a-z][a-z0-9-]*(\([^()]+\))?(!)?: .+' + if [[ ! $PR_TITLE =~ $pattern ]]; then + echo "Pull request titles must use Conventional Commit syntax." >&2 + echo "Examples: feat: add a feature, fix(api): correct behavior, feat!: break compatibility" >&2 + exit 1 + fi