skillhub/scripts
Cheney 0b1c366f8d
refactor(cli): improve publish-cli script reliability (#441)
* refactor(cli): improve publish-cli script reliability

- Move version computation and pre-flight checks before build-and-test
  to fail fast on conflicts (existing branch/tag) instead of wasting
  minutes on lint/test/build
- Add INT/TERM signal handlers to cleanup trap so Ctrl+C during build
  properly restores working tree state
- Update Makefile help text to reflect PR-based workflow

* fix(cli): use git checkout -f for robust cleanup

Address code review feedback from gemini-code-assist bot:

- Use `git checkout -f` in on-release and committed cleanup stages
  to ensure reliable branch switching even when files are staged
  but not committed (e.g., interrupted after `git add` but before
  `git commit`)
- Remove redundant `git checkout -- <file>` in on-release stage
  since `-f` already discards all local changes

This prevents cleanup failures when the script is interrupted
between staging and committing.

* fix(cli): address PR #441 review findings

- Fix ERR trap bypass: remove `if !` wrapper around `gh pr create` so
  set -e triggers the trap and prints pushed-stage recovery instructions
- Fix command injection: all node -e/-p calls now use process.env
  instead of interpolating shell variables into JS string literals
- Rewrite cli/RELEASE.md to document the new PR-based release flow
- Rewrite scripts/tests/publish-cli-test.sh with 10 tests covering
  the new flow (stubs for bun/gh, pre-flight checks, happy path,
  cleanup state machine stages)

* fix(cli): address PR #441 review findings from @dongmucat

- Bind release tag to origin/main: PR body, end-of-run hint, and
  cli/RELEASE.md now use `git tag $TAG origin/main` so the tag is
  always placed on the merged commit, regardless of local branch state
- Reject prerelease tags in version computation: if the latest cli-v*
  tag contains non-X.Y.Z characters (e.g., -rc.1), exit with a clear
  message instead of crashing in node parsing
- Add pr-scripts.yml workflow: runs publish-cli-test.sh on scripts/**
  changes so the release script regression suite gates PRs
- Add Test 11 covering prerelease tag rejection

* fix(cli): compute publish baseline from origin tags only

A failed `git push origin cli-vX.Y.Z` after a successful local tag
leaves an orphan tag locally. The previous `git tag --list` baseline
would then treat it as the latest release, causing skipped versions or
publishes based on an unreleased tag.

Switch to `git ls-remote --tags --refs origin 'cli-v*' | sort -V` so
the baseline reflects only what is actually on origin. Local orphan
tags can still collide with the computed target tag, which fails fast
with a clear message as before.

Adds test 12 covering the orphan-tag scenario.
2026-06-02 14:30:39 +08:00
..
tests refactor(cli): improve publish-cli script reliability (#441) 2026-06-02 14:30:39 +08:00
check-openapi-generated.sh fix: stabilize backend dev startup flow 2026-03-16 16:03:46 +08:00
deploy-test-runtime.sh feat(ci): add PR batch test deployment workflow (#275) 2026-04-09 18:45:14 +08:00
dev-process.sh fix(dev): ignore invalid backend pid files 2026-03-23 17:14:16 +08:00
governance-smoke-test.sh feat: build governance center workflow 2026-03-16 16:03:46 +08:00
mirror-runtime-images.sh feat(ops): add optional runtime registry mirroring 2026-03-15 14:30:04 +08:00
namespace-smoke-test.sh test: cover namespace workflow smoke paths 2026-03-16 16:03:46 +08:00
parallel-common.sh refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
parallel-down.sh refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
parallel-init.sh refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
parallel-sync.sh refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
parallel-up.sh refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
prepare-pr-batch.sh feat(ci): add PR batch test deployment workflow (#275) 2026-04-09 18:45:14 +08:00
promotion-smoke-test.sh feat: complete skill promotion submission flow 2026-03-16 16:03:46 +08:00
publish-cli.sh refactor(cli): improve publish-cli script reliability (#441) 2026-06-02 14:30:39 +08:00
runtime.sh Fix runtime Postgres password drift (#321) 2026-04-17 17:45:34 +08:00
skillhub-test-deploy-remote.sh Fix runtime Postgres password drift (#321) 2026-04-17 17:45:34 +08:00
smoke-test.sh refactor: address code review findings from 2026-03-22 2026-03-23 13:48:23 +08:00
validate-release-config.sh fix: enable bootstrap admin by default for zero-config quickstart (#175) 2026-03-27 19:00:24 +08:00
verify-scanner.sh feat(security): add security scanning system with multi-scanner support and frontend UI (#144) 2026-03-23 09:56:03 +08:00