Skip to content

Commit c79cd0b

Browse files
authored
Merge pull request #4 from flowglad/fix/auto-tag-mode-flip
fix(release): tolerate executable-bit flips in tag-script status checks
2 parents 75353b8 + 51e94cf commit c79cd0b

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)