mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-31 14:06:50 +01:00
G1: quote the base placeholder in document-release title sync
The title-sync block is checked with bash -n; an unquoted <base> parses as a redirection. Migrates the test that pinned the old root VERSION read to the shared classifier call.
This commit is contained in:
1 parent
bd1d7d0d34
commit
214cf0b364
2 files changed
+3
-2
No files matched your search
@@ -369,7 +369,7 @@ PR titles must start with `v<VERSION>` whenever the project has a version source
|
||||
Run this entire block in one shell, substituting `github` or `gitlab` for `<platform>` from Step 0 and the base branch for `<base>`. No variables cross tool calls. No version source (NO_VERSION) or no PR/MR skips title sync; an update failure warns and continues.
|
||||
|
||||
```bash
|
||||
VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify --base <base>) || { echo "Title sync: not run (the version source is broken; see the error above)."; exit 0; }
|
||||
VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify --base "<base>") || { echo "Title sync: not run (the version source is broken; see the error above)."; exit 0; }
|
||||
V=$(echo "$VB" | jq -r '.currentVersion // empty')
|
||||
[ -n "$V" ] || { echo "Title sync: not applicable (no version source is configured)."; exit 0; }
|
||||
case "<platform>" in
|
||||
|
||||
@@ -43,7 +43,8 @@ describe("/document-release redaction", () => {
|
||||
test("title synchronization keeps every variable in one valid shell block", () => {
|
||||
const section = RELEASE.slice(RELEASE.indexOf('**PR/MR title sync'));
|
||||
const script = section.match(/```bash\n([\s\S]*?)\n```/)![1];
|
||||
for (const command of ['V=$(cat VERSION', 'CURRENT_TITLE=$(gh pr view', 'NEW_TITLE=$(', 'gh pr edit --title "$NEW_TITLE"', 'glab mr update -t "$NEW_TITLE"']) {
|
||||
// G1 (#2334): the version comes from the shared classifier, not a root VERSION read.
|
||||
for (const command of ['VB=$(bun run ~/.claude/skills/gstack/bin/gstack-version-bump classify', 'CURRENT_TITLE=$(gh pr view', 'NEW_TITLE=$(', 'gh pr edit --title "$NEW_TITLE"', 'glab mr update -t "$NEW_TITLE"']) {
|
||||
expect(script).toContain(command);
|
||||
}
|
||||
const result = spawnSync('bash', ['-n'], { input: script, encoding: 'utf8', timeout: 5000 });
|
||||
|
||||
Reference in new issue
Block a user