fix(ci): restore scripts/test.sh — broke when removed in 'cleanup' commit #131

Closed
mik-tf wants to merge 2 commits from development_mik_ci_test_sh into development
Owner

Why CI is red

The build-and-publish workflow on hero_skills/development has been failing every push for ~2 months with:

bash: scripts/test.sh: No such file or directory
make: *** [Makefile:47: test] Error 127

Root cause: commit ce18f5f ("cleanup", 2026-02-16) deleted scripts/test.sh (-74 lines) but did not update the Makefile target test: (line 47) or the .forgejo/workflows/build.yaml step that calls make test. So every CI run since has died at the same step.

Fix

Restore the script — long-term prod fix, not a workaround. Two improvements over the deleted version:

  1. SKILLS_DIR sourced from buildenv.sh (with optional positional override for ad-hoc use) — future renames in buildenv track automatically, no code edits needed.
  2. Validation tightened:
    • SKILL.md exists (case-insensitive — accepts skill.md too)
    • Starts with --- frontmatter delimiter
    • Frontmatter contains name: and description: fields
    • Non-empty body content after closing ---

Output is colourised when stdout is a tty, plain otherwise (clean CI logs). Skills validated in sorted order — output diffs are stable. Exit codes:

  • 0 — all pass
  • 1 — validation failure
  • 2 — invocation error (missing buildenv.sh, etc.)

Validation

$ make test
[...]
Checked: 75 skills
All skills valid.

All 75 skills under claude/skills/ pass. make test runs in <1s.

No Makefile or workflow changes — only the missing script is restored.

Signed-off-by: mik-tf

## Why CI is red The `build-and-publish` workflow on `hero_skills/development` has been failing every push for ~2 months with: ``` bash: scripts/test.sh: No such file or directory make: *** [Makefile:47: test] Error 127 ``` Root cause: commit [`ce18f5f`](https://forge.ourworld.tf/lhumina_code/hero_skills/commit/ce18f5f) ("cleanup", 2026-02-16) deleted `scripts/test.sh` (-74 lines) but did **not** update the Makefile target `test:` (line 47) or the `.forgejo/workflows/build.yaml` step that calls `make test`. So every CI run since has died at the same step. ## Fix Restore the script — long-term prod fix, not a workaround. Two improvements over the deleted version: 1. **`SKILLS_DIR` sourced from `buildenv.sh`** (with optional positional override for ad-hoc use) — future renames in buildenv track automatically, no code edits needed. 2. **Validation tightened:** - `SKILL.md` exists (case-insensitive — accepts `skill.md` too) - Starts with `---` frontmatter delimiter - Frontmatter contains `name:` and `description:` fields - Non-empty body content after closing `---` Output is colourised when stdout is a tty, plain otherwise (clean CI logs). Skills validated in sorted order — output diffs are stable. Exit codes: - `0` — all pass - `1` — validation failure - `2` — invocation error (missing buildenv.sh, etc.) ## Validation ``` $ make test [...] Checked: 75 skills All skills valid. ``` All 75 skills under `claude/skills/` pass. `make test` runs in <1s. No Makefile or workflow changes — only the missing script is restored. Signed-off-by: mik-tf
CI's `make test` step has been silently failing since commit ce18f5f
('cleanup', 2026-02-16) which deleted scripts/test.sh without updating
the Makefile or the .forgejo workflow that call it.  Every push to
development since has produced a red 'build-and-publish' run with
`bash: scripts/test.sh: No such file or directory`.

Restored the script with two improvements over the deleted version:

1. SKILLS_DIR is now sourced from buildenv.sh (with optional positional
   override for ad-hoc use), so future renames track buildenv without
   code edits.

2. Validation tightened:
   - SKILL.md exists (case-insensitive — accepts skill.md too)
   - Starts with `---` frontmatter delimiter
   - Frontmatter contains `name:` and `description:` fields
   - Non-empty body content after closing `---`

Output is colourised when stdout is a tty, plain otherwise (clean CI
logs).  Skills are validated in sorted order so output diffs are stable.
Exit codes: 0 = all pass, 1 = validation failure, 2 = invocation error.

Validated locally: all 75 skills under claude/skills/ pass.  `make test`
runs cleanly in <1s.

Long-term prod fix — not a workaround.  The Makefile + workflow stay
unchanged; only the missing script is restored.

Signed-off-by: mik-tf
fix(ci): fire on PRs targeting development; gate Publish to push only
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
f54361469d
Without `pull_request:` trigger, reviewers had no green/red signal on
PRs (the workflow only fired after merge to development — too late).

- Adds `pull_request: branches: [development]` trigger so every PR
  targeting development gets build + test feedback before merge.
- Adds `if: github.event_name == 'push' && github.ref == 'refs/heads/development'`
  guard on the Publish step so PR runs stop after test — reviewers
  get a pass/fail signal without a stray release being produced from
  someone's branch.

Push to development still runs the full pipeline (build → test →
publish) unchanged.

Signed-off-by: mik-tf
mik-tf closed this pull request 2026-04-25 20:46:00 +00:00
Author
Owner

Squash-merged to development as 70e11ef. Branch deleted.

Squash-merged to `development` as [`70e11ef`](https://forge.ourworld.tf/lhumina_code/hero_skills/commit/70e11ef). Branch deleted.
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!131
No description provided.