Skip to content

Add PR-validation workflow (run build on PRs, no deploy) #3

Description

@ChrisonSimtian

Context

Falloutdocs currently has one workflow: `.github/workflows/deploy.yml`, which runs on push to `main`, on the daily schedule, and on manual dispatch. There is no workflow that runs on pull requests. This means every PR to this repo merges blind — any breakage (broken links once `onBrokenLinks: 'throw'` lands, TypeScript errors, dependency resolution failures, etc.) is only caught after the merge to main, at which point the site falls behind until someone fixes forward.

Why this matters more now

PR #2 (ChrisonSimtian/Fallout#192 follow-up) flips `onBrokenLinks: 'warn'` to `'throw'`. Once that lands, any future content change in ChrisonSimtian/Fallout/docs that introduces a broken link will fail the Falloutdocs build, and `docs.fallout.build` will stop receiving updates until a fix lands. PR-validation catches these before they hit main.

Done when

  • New `.github/workflows/ci.yml` runs on `pull_request` targeting `main`.
  • Workflow checks out Falloutdocs and `ChrisonSimtian/Fallout@main` (same two-checkout shape as `deploy.yml`).
  • Runs `npm ci` and `npm run build`.
  • Does not deploy to GitHub Pages.
  • Runs on Node 22 to match `deploy.yml`.

Approach hints

  • Easiest: copy the `build` job from `deploy.yml` into a new `ci.yml` with `on: pull_request: branches: [main]` and drop the `upload-pages-artifact` / `deploy` steps.
  • Or refactor: extract the build steps into a reusable workflow (`workflow_call`) and call it from both `ci.yml` (no deploy) and `deploy.yml` (with deploy). Probably overkill for a two-workflow repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions