Repository navigation
{
"RELEASE_NOTES": {
"title": "1.0.9 — Workflow validation (actionlint + tests), workflow bug fixes, and release version bump",
"body": "Summary
- This release finalizes the package version to 1.0.9 and primarily adds workflow validation and testing for GitHub Actions. It fixes a couple of bash/YAML issues in the CI workflows and adds scripts/tests to prevent similar mistakes going forward.
Highlights
- Version bump: package.json updated from 1.0.8 → 1.0.9 (non-dev release).
- New workflow validation tooling:
- scripts/lint-actions.sh — run actionlint if installed, otherwise run fallback checks.
- scripts/test-workflow-bash.sh — extract and perform basic checks on bash embedded in workflow run: blocks (reports warnings).
- tests/workflow-bash.test.js — Vitest tests that validate run: bash blocks in .github/workflows (presence, conditional spacing, balanced if/fi, and file rename checks).
- docs/TESTING_WORKFLOWS.md — detailed guide describing the workflow testing strategy, tools, and best practices.
- package.json scripts updated to integrate the new checks:
- Added: lint:workflows, lint:actions
- precommit now runs npm run lint:actions && npm test (previously ran lint:yaml && npm test)
- Fixes in workflow YAML files:
- .github/workflows/benchmark.yml — corrected the logic that creates index.html (adds missing fi and only creates index.html when needed) and removed an incorrect echo placement. This avoids referencing renamed files after a mv and prevents missing-index cases.
- .github/workflows/test.yml — fixed bash conditional syntax in summary-building steps (added required spaces in [ conditions), preventing runtime shell errors.
- Commit includes incidental generated artifacts from running install/test tooling (node_modules/.package-lock.json and node_modules/.vite/vitest/results.json). These are build/test artifacts, not functional changes.
Why this matters
- Prevents a common, expensive class of errors: bash syntax issues embedded in workflow YAML (examples: missing spaces in [ conditionals, unbalanced if/fi, references to files after they were mv'd). The repo previously suffered repeated CI failures that were only discovered during full CI runs — now many of those errors are caught locally or earlier in the pipeline.
- Adds both static checks and runtime-style tests for workflow run: blocks so changes to workflows are validated before expensive CI runs.
- The docs provide a repeatable strategy (from fast static checks to local runtime with act) so contributors know how to validate workflows.
Impact for users and developers
- Developers:
- New commands available:
- npm run lint:actions — primary entry point to validate workflows (uses actionlint if present, otherwise falls back to lint:yaml + lint:workflows)
- npm run lint:workflows — runs scripts/test-workflow-bash.sh (basic bash checks on workflows)
- npm run lint:yaml — existing YAML linting
- npm run precommit — now runs lint:actions && npm test
- Recommended: install actionlint for the most comprehensive workflow validation (brew install actionlint or go install github.com/rhysd/actionlint/cmd/actionlint@latest). If actionlint is installed, lint-actions will run actionlint and will fail on issues; otherwise it falls back to the repository's checks.
- The added Vitest tests (tests/workflow-bash.test.js) run as part of npm test; workflow issues that the tests cover will fail the test suite and block publishing/CI.
- New commands available:
- CI / automation:
- Workflows themselves were corrected (benchmark.yml and test.yml) so CI runs should be more reliable and no longer fail on the specific bash/YAML bugs fixed in this release.
Behavioral / compatibility notes
- No breaking API changes to the package code are included. This release focuses on CI/workflow validation and a version bump.
- Precommit behavior is slightly different:
- Previously precommit ran lint:yaml && npm test.
- Now precommit runs lint:actions && npm test.
- If actionlint is present and finds problems, lint:actions will exit non-zero (failing precommit). If actionlint is not installed, lint:actions falls back to lint:yaml and lint:workflows; the repository's test-workflow-bash.sh currently warns about bash issues rather than failing (it intentionally exits 0 on warnings), but the Vitest workflow tests will fail in npm test when issues are detected. In short, precommit may be stricter if actionlint is present — this is intentional to catch workflow errors earlier.
What to do / Migration notes
- To get the best local checks, install actionlint:
- brew install actionlint
- or: go install github.com/rhysd/actionlint/cmd/actionlint@latest
- Run the new checks locally before pushing:
- npm run precommit (recommended — runs lint:actions + npm test)
- npm run lint:actions (just workflow validation)
- npm run lint:workflows (run the repository's bash checks for workflows)
- Read docs/TESTING_WORKFLOWS.md for guidance on levels of testing and how to run workflows locally with act.
Files of note in this release
- package.json — version bumped to 1.0.9; new scripts: lint:workflows, lint:actions; precommit updated
- .github/workflows/benchmark.yml — fixed index.html generation and file rename logic in a run: block
- .github/workflows/test.yml — fixed bash conditional syntax in GHA job step
- scripts/lint-actions.sh — new top-level workflow linter wrapper
- scripts/test-workflow-bash.sh — new script that extracts bash from workflow run: blocks and performs basic checks/warnings
- tests/workflow-bash.test.js — Vitest tests validating workflow run: blocks (spacing in conditionals, balanced if/fi, file rename references)
- docs/TESTING_WORKFLOWS.md — new comprehensive documentation on workflow testing
Notes about included artifacts
- The release commit includes generated files produced by running install/test tooling (node_modules/.package-lock.json and node_modules/.vite/vitest/results.json). These are incidental build/test artifacts and not functional changes to source code.
Known limitations / future improvements
- scripts/test-workflow-bash.sh currently prints warnings and exits 0 when it finds potential bash issues (it is intentionally non-failing so local checks will not block). The Vitest tests are the enforcement mechanism in CI. If you prefer the bash script to fail fast locally, update it to exit non-zero on issues.
- actionlint provides stronger validation than the fallback checks; prefer installing actionlint for stricter precommit validation.
Changelog (summary)
- Added: workflow validation docs, actionlint wrapper, workflow bash tests
- Fixed: bash conditionals and index.html creation in workflow YAML files
- Changed: precommit runs lint:actions (and npm test)
- Bumped: package.json version to 1.0.9
If anything in CI appears different after this release, verify you have the latest precommit scripts and consider installing actionlint to reproduce local validation behavior."
}
}