Skip to content

Commit 51e94cf

Browse files
subsetparkclaude
andcommitted
fix(release): tolerate executable-bit flips in tag-script status checks
The auto-tag workflow failed on the first run after flowglad-main got the fix for the empty-ArrayBuffer dbBuffer regression: Error: Validation changed files. Commit the build output first, then rerun: M packages/just-bash/dist/bin/just-bash.js M packages/just-bash/dist/bin/shell/shell.js esbuild emits dist/bin/*.js at mode 100644 on Linux, but those files were originally committed at mode 100755 and the create-flowglad-package-tag.mjs status checks could not tell the difference between an executable-bit flip (spurious) and a real content change (a legitimately uncommitted dist). Two-part fix: - Pass `-c core.fileMode=false` to the pre-validation and post-validation `git status --porcelain` calls so the script ignores executable-bit diffs between index and working tree. Real content drift still aborts the run. - Chmod the committed `dist/bin/just-bash.js` and `dist/bin/shell/shell.js` index entries from 100755 to 100644, matching what esbuild produces. The blob hashes are unchanged. npm/Bun set the executable bit at install time via the package.json `bin` field, so consumers are unaffected. After this, an auto-tag run on a flowglad-main HEAD whose dist matches a clean rebuild will pass; an auto-tag run on a HEAD with stale dist will still abort with the existing error message. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 75353b8 commit 51e94cf

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

packages/just-bash/dist/bin/just-bash.js

100755100644
File mode changed.

packages/just-bash/dist/bin/shell/shell.js

100755100644
File mode changed.

scripts/create-flowglad-package-tag.mjs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,16 @@ if (currentBranch !== branch) {
9191
);
9292
}
9393

94-
const status = run("git", ["status", "--porcelain"], { capture: true });
94+
// `-c core.fileMode=false` so executable-bit flips don't show up here. esbuild
95+
// emits dist/bin/*.js at mode 100644 on Linux, but those files were originally
96+
// committed at 100755 (and macOS preserves that on rebuild), so a CI rebuild
97+
// would otherwise look like a "dirty worktree" or "validation changed files"
98+
// even when no content changed.
99+
const status = run(
100+
"git",
101+
["-c", "core.fileMode=false", "status", "--porcelain"],
102+
{ capture: true },
103+
);
95104
if (status) {
96105
throw new Error(`Refusing to release with a dirty worktree:\n${status}`);
97106
}
@@ -143,9 +152,11 @@ if (!skipValidation) {
143152
"src/commands/python3/python3.optin.test.ts",
144153
]);
145154

146-
const postValidationStatus = run("git", ["status", "--porcelain"], {
147-
capture: true,
148-
});
155+
const postValidationStatus = run(
156+
"git",
157+
["-c", "core.fileMode=false", "status", "--porcelain"],
158+
{ capture: true },
159+
);
149160
if (postValidationStatus) {
150161
throw new Error(
151162
`Validation changed files. Commit the build output first, then rerun:\n${postValidationStatus}`,

0 commit comments

Comments
 (0)