ci: add format, lint, type-check and PR title workflows#33
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Code ReviewOverviewThis PR establishes CI/CD foundations by adding GitHub Actions workflows for format, lint, and type-check validation, plus PR title enforcement. Overall a solid addition — the structure is clean and follows common conventions. Potential Bugs / Issues
Performance Considerations
Security Concerns
Minor Notes
SummaryThe CI foundation is well-structured. The main items worth addressing before merge are the |
Allows astro check to run in CI where CMS_URL/CMS_API_KEY aren't set.
Preview Deployment
The Web preview uses the CMS preview URL for content fetching. |
Code ReviewOverviewThis PR adds GitHub Actions CI workflows (format, lint, type-check, PR title validation) and the supporting Potential Bugs / Issues
Performance ConsiderationsThree independent Unpinned tool versions - Security Concerns
Missing SummarySolid CI foundation and a correct
|
- prettier --write on drifted files - use set:html template literal for analytics script in 404/500 pages so prettier-plugin-astro can parse the surrounding JSX expression
Code ReviewOverviewThis PR adds automated CI/CD pipelines (format, lint, type-check, PR title validation) and a few formatting-only fixes across the frontend. Solid addition overall. Potential Bugs / Issues
Performance ConsiderationsRedundant install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
format:
needs: install
...This is a minor optimization and the current approach is perfectly functional. Security ConcernsThird-party action pinned to a mutable tag - uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3The official GitHub-maintained actions ( Missing explicit permissions in permissions:
contents: readMinor Notes
|
CollectionSlug from 'payload' widens to string in this project's setup; payloadSDK.find requires keyof Config['collections'].
- Merge format/lint/type-check into a single job so pnpm install and Node setup run once instead of three times. - Add top-level permissions: contents: read per least-privilege.
Code ReviewOverviewThis PR adds CI/CD infrastructure (format check, lint, type check, PR title validation workflows) and fixes several code quality issues (import ordering, Tailwind class ordering, inline script formatting). Mostly straightforward and well-scoped. Potential Bugs / IssuesSequential CI steps vs. parallel jobs
Security ConcernsThird-party action not pinned to a commit SHA # pr-title.yml
- uses: amannn/action-semantic-pull-request@v5
- uses: amannn/action-semantic-pull-request@0135e35e22f8b5a64b7c40d34d5a3f9dd4bee5eb # v5.5.3The first-party actions ( Performance Considerationspnpm/node version pinning version: 9 # pnpm
node-version: 22 # nodeMajor-only pins mean silent upgrades if pnpm releases 10.x or Node releases 22.x patches with breaking changes. Consider:
No build step in CI Minor Positives
SummaryThe CI foundation is solid. The two most actionable items before merge are: pin |
Code ReviewOverviewThis PR adds CI/CD infrastructure: a GitHub Actions workflow for format/lint/type checks, PR title validation enforcing semantic commits, and Potential Bugs
- document.addEventListener('DOMContentLoaded', function () {
+ document.addEventListener('astro:page-load', function () {
Performance ConsiderationsCI steps are sequential, not parallel jobs:
format:
runs-on: ubuntu-latest
steps: [checkout, setup, install, format:check cms, format:check web]
lint:
runs-on: ubuntu-latest
steps: [checkout, setup, install, lint cms, lint web]
typecheck:
runs-on: ubuntu-latest
steps: [checkout, setup, install, check cms, check web]Security Considerations
if (!process.env.CMS_URL || !process.env.CMS_API_KEY) {
if (process.env.VERCEL_ENV === 'production') {
throw new Error('CMS_URL and CMS_API_KEY must be set in production')
}
console.warn('[getRedirects] CMS credentials not set — skipping redirects fetch.')
return {}
}
Minor / Positive Notes
|
Removes the Node.js 20 deprecation warning on GitHub Actions runners.
… failure Running format/lint/type-check as separate jobs surfaces all category failures in one CI run and produces independent PR status checks. Within each job, the web step runs even if the cms step fails so both package results are visible in a single run.
Code ReviewOverviewThis PR adds CI/CD automation (format check, lint, type-check, PR title validation) and a handful of formatting fixes. The overall approach is solid — parallel jobs, minimal permissions, and sensible Potential Bugs / Issues1. Action versions likely do not exist ( 2. concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}3. 4. Performance ConsiderationsEach of the three CI jobs independently runs Security Considerations
Minor / FormattingThe remaining changes (import reordering, Tailwind class ordering, trailing commas, script tag reformatting) are clean Prettier/ESLint fixes with no behavioural impact. Summary: The main actionable items are the action version numbers (likely broken as-is), the concurrency behaviour on |
- web/404.astro: tailwind class order shuffled - web/ci-test-violations.ts: unused var + number/string mismatch - cms/ci-test-violations.ts: unsorted imports + formatting + type error To be reverted after CI confirms all 6 sub-checks fail.
Code ReviewOverviewThis PR establishes CI/CD pipelines with format checking, linting, and type checking workflows, plus 🔴 Must Fix Before MergingTest violation files left in the PR Action versions likely incorrect uses: actions/checkout@v6 # latest stable is @v4
uses: actions/setup-node@v6 # latest stable is @v4
uses: pnpm/action-setup@v6 # latest stable is @v4Using non-existent action versions will cause every CI run to fail at the runner setup step. Pin to the current latest ( 🟡 Potential IssuesNo build job in CI
🟢 Positive Changes
Minor
|
Code ReviewOverviewThis PR establishes a CI/CD foundation with format, lint, and type-check workflows plus PR title validation. The bulk of the non-workflow changes are Prettier-driven formatting fixes (import ordering, Tailwind class ordering, trailing commas). Potential Bugs / IssuesCritical: Invalid action versions in The workflow references versions that do not exist: - uses: actions/checkout@v6 # latest stable: v4
- uses: pnpm/action-setup@v6 # latest stable: v4
- uses: actions/setup-node@v6 # latest stable: v4These will fail at runtime (or resolve unpredictably). Change all three to
The new guard: if (!process.env.CMS_URL || !process.env.CMS_API_KEY) {
console.warn('[getRedirects] CMS_URL or CMS_API_KEY not set — skipping redirects fetch.')
return {}
}is correct for CI type-checks, but if these env vars are accidentally missing in a real deployment the site would silently serve no redirects. Consider throwing in non-CI environments, or at least making the log message clearly distinguishable (e.g. Performance Considerations
Security Considerations
Minor
SummaryThe action version mismatch is a blocker — the CI workflows will fail immediately on first run. Everything else is solid; the formatting fixes and |
Code ReviewOverviewThis PR establishes CI/CD pipelines (format, lint, type-check, PR title validation) and adds related npm scripts. It also includes several formatting-only fixes and a defensive guard in Potential Bugs / IssuesAction versions may not exist
No Performance ConsiderationsRepeated dependency installs across jobs Security ConsiderationsActions pinned to tags, not SHAs
Positive Notes
|
Summary
This PR establishes automated CI/CD pipelines and adds formatting validation to the project. It introduces GitHub Actions workflows for continuous integration and adds npm scripts for checking code formatting without modifying files.
Key Changes
CI Workflow (
.github/workflows/ci.yml): Added comprehensive GitHub Actions workflow that runs on every push and pull request tomain, including:cmsandwebpackagescmsandwebpackagescmsand Astro checking forwebPR Title Validation (
.github/workflows/pr-title.yml): Added workflow to enforce semantic commit conventions on pull request titles with scopes forwebandcmsFormat Check Scripts: Added
format:checknpm scripts to both packages:cms/package.json: Addedformat:checkscript using Prettier in check modeweb/package.json: Addedformat:checkscript using Prettier in check modeType Check Script: Added
checkscript tocms/package.jsonfor TypeScript type checking without emitting filesImplementation Details
https://claude.ai/code/session_018Jbn2fhYkgnRgdJ1sreXPG