Repository navigation
Conversation
Trigger the build-and-lint workflow on pull requests and pushes for main and production; it previously ran only on PRs into production, which no PR has ever targeted. Split the Pages deploy into an unprivileged build job (now also runs lint and installs with --ignore-scripts) and a deploy job that is the only one holding pages/id-token write. Pin all actions to commit SHAs and stop cancelling in-progress deploys. Document the main-to-production release flow in the README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Pull request checks" workflow only ran on pull requests into
production. Every PR in this repo targetsmain, andproductionis moved by a direct push or fast-forward, so the lint and build checks have never actually run on a change. The deploy workflow also skippednpm run lint, so a lint error, including a react-hooks rule violation that still compiles, could reach the live course map without anything catching it.This PR makes CI run where work happens and tightens the deploy workflow:
mainandproductionand on pushes to both branches.User impact: none on the site itself. Contributors get lint and build feedback on their PRs, and releases are blocked if lint fails.
Changes
.github/workflows/ci.ymlpull_requestandpushformainandproduction. Before, onlypull_requestintoproductiontriggered it.persist-credentials: falsebecause nothing needs to push..github/workflows/deploy.ymlpermissions: {}. Each job asks only for what it needs.buildjob (contents: read): checkout, setup-node,npm ci --ignore-scripts,npm run lint,npm run build, then upload the Pages artifact. The only locked dependency with an install script isfsevents, a macOS-only optional dependency that isn't installed on the Linux runner, so--ignore-scriptsdoesn't change the CI install today. It stops a future or compromised dependency from running code at install time.deployjob (needs: build,pages: write,id-token: write,github-pagesenvironment): onlyconfigure-pagesanddeploy-pages. No repository code or npm packages run in this job.concurrency.cancel-in-progressis nowfalse, which matches GitHub's Pages starter workflow. A second push queues behind a running deploy instead of cancelling it partway.checkoutv4.4.0,setup-nodev4.4.0,configure-pagesv5.0.0,upload-pages-artifactv3.0.1,deploy-pagesv4.0.5. Each pin has a trailing version comment so Dependabot can keep it current once it is configured forgithub-actions. That config comes from the separate Vite upgrade PR, which adds.github/dependabot.yml. Until it merges, the pins don't update on their own.README.md: new short "Continuous integration and deployment" section. It explains that PRs go tomain, merging intomaindoesn't deploy, and the site deploys fromproduction.Not changed on purpose: no
if: github.ref == 'refs/heads/production'guard was added to the deploy job. Thegithub-pagesenvironment's deployment-branch policy already accepts onlyproduction, so a manual run from any other branch is already refused.Testing
Run locally on Node 22:
npm ci --ignore-scriptssucceeded. This is the same install command the deploy build job now uses.npm run lintpassed with no errors.npm run build(tsc -b && vite build) passed.actionlint@2.0.6) onci.ymlanddeploy.ymlreported no problems. As a sanity check, it did flag errors in a deliberately broken workflow.git ls-remoteagainst eachactions/*repository. They match the commits the currentv4/v5/v3tags point to. None of the tags is annotated, so the SHAs are commit SHAs.Not tested here (only GitHub can run it):
pull_requestevents GitHub uses the workflow file from the PR merge ref, so "CI / Build and lint" should show up on this PR. That is the first live check.production. After the next release, check that both thebuildanddeployjobs succeed and the site updates at/seaview-interactive-map/.Merge / deploy notes
Merge this first so the following seaview PRs get CI. Other PRs that are already open only pick up the new trigger on their next push, so push to or rebase them after this merges.
The other seaview PR in this set, the Vite upgrade (
claude-review/vite-upgrade), changespackage-lock.jsonand adds.github/dependabot.yml. It touches no files from this PR, and the two branches merge without conflicts. Recommended order: this PR first, then the Vite upgrade, so the Vite upgrade gets a CI run and its Dependabot config starts keeping these action pins current.Merging into
maindoesn't deploy. The new deploy workflow first runs on the next push toproduction, so watch that run.Optional maintainer follow-ups (repository settings, not code):
mainandproductionthat requires the "Build and lint" check. The repo is public, so this is available on the current plan.github-pagesenvironment limited toproduction.🤖 Generated with Claude Code