From f3d8a6e302cfc404bce2c26547eb937ef3bda454 Mon Sep 17 00:00:00 2001 From: Daniel Kutyla Date: Sun, 8 Mar 2026 15:38:58 +0100 Subject: [PATCH] Update README customization example to include if-guards The checks job now uses per-step if conditions so non-feature PRs (like back-merge PRs) pass without running CI. The README example must reflect this to avoid confusing adopters. --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c02d9d..937c85b 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ See [docs/BRANCH-RULES.md](docs/BRANCH-RULES.md) for full details and manual set ### Adding CI Steps -Edit the `checks` job in `feature.yml` to add your build, test, and lint steps: +Edit the `checks` job in `feature.yml` to add your build, test, and lint steps. Keep the `if:` condition on each step so that non-feature PRs (like back-merge PRs) pass without running CI: ```yaml # In .github/workflows/feature.yml @@ -120,15 +120,23 @@ checks: runs-on: ubuntu-latest needs: validate steps: + - name: Skip non-feature branches + if: needs.validate.outputs.is_feature != 'true' + run: echo "Not a feature branch — skipping CI checks." + - uses: actions/checkout@v4 + if: needs.validate.outputs.is_feature == 'true' - name: Install dependencies + if: needs.validate.outputs.is_feature == 'true' run: npm ci - name: Lint + if: needs.validate.outputs.is_feature == 'true' run: npm run lint - name: Test + if: needs.validate.outputs.is_feature == 'true' run: npm test ```