From 7ed5f62e138d12aa6d548c24d7a522f99dd75794 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Mon, 26 Oct 2026 06:21:00 -0600 Subject: [PATCH] ci: don't let textlint or prettier block preview builds ## The Issue On PR #765, `no-todo` errors from textlint stopped both the fork preview build and the `build` job in `test.yml`, so no preview was produced for a draft that only had wording problems. ## How This PR Solves The Issue - `cloudflare-preview-forks-build.yml` no longer runs textlint or prettier. `test.yml` already runs them on fork PRs. - `test.yml` moves textlint and prettier into their own `lint` job, so they still fail the PR but no longer stop `build`. Prettier runs even when textlint fails, so both results show up at once. ## Manual Testing Instructions Open a PR with a `TODO:` in a blog post, both from a branch on ddev/ddev.com and from a fork. The `lint` check should fail, while `build` and `Build site (no secrets)` succeed and the preview deploys. Co-Authored-By: Claude Opus 5.5 --- .../workflows/cloudflare-preview-forks-build.yml | 8 ++------ .github/workflows/test.yml | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cloudflare-preview-forks-build.yml b/.github/workflows/cloudflare-preview-forks-build.yml index 5d9f59ed..77c19eb6 100644 --- a/.github/workflows/cloudflare-preview-forks-build.yml +++ b/.github/workflows/cloudflare-preview-forks-build.yml @@ -78,12 +78,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Lint - run: npm run textlint || { printf "Run 'ddev textlint' locally to fix it.\n\n"; exit 1; } - - - name: Prettier - run: npm run prettier || { printf "\nRun 'ddev prettier' locally to fix it.\n\n"; exit 1; } - + # textlint and prettier run in test.yml. They are left out here so a + # wording or formatting problem doesn't hold back the preview. - name: Build run: npm run build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 871ee3dc..ab7fab14 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,8 +15,10 @@ env: NODE_VERSION: 24 jobs: - build: - timeout-minutes: 15 + # A separate job, so a wording or formatting problem fails this check + # without stopping the build. + lint: + timeout-minutes: 10 runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v7 @@ -28,7 +30,17 @@ jobs: - name: Lint run: npm run textlint || { printf "Run 'ddev textlint' locally to fix it.\n\n"; exit 1; } - name: Prettier + if: ${{ !cancelled() }} run: npm run prettier || { printf "\nRun 'ddev prettier' locally to fix it.\n\n"; exit 1; } + + build: + timeout-minutes: 15 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version: ${{ env.NODE_VERSION }} - name: Load Amplitude secrets # Skipped for forked-repo PRs: GitHub Actions never exposes secrets to those # anyway, but this avoids depending on that alone and skips a step that