Skip to content

Scaffold deploy-action and prepare for public OSS release#1

Merged
half-ogre merged 14 commits into
mainfrom
feat/initial-action
Apr 27, 2026
Merged

Scaffold deploy-action and prepare for public OSS release#1
half-ogre merged 14 commits into
mainfrom
feat/initial-action

Conversation

@half-ogre

Copy link
Copy Markdown
Contributor

Summary

This PR:

  • Adds the Hyphen Deploy GitHub Action that wraps hx deploy, captures the JSON output from the CLI, and exposes deployment-id, run-id, deployment-url, status, and reason as step outputs.
  • Mirrors the conventions established by env-action and setup-hx-action (workflows, linters, dependabot, devcontainer, package layout, helper module structure) so the three actions stay in lockstep.
  • Hardens the CLI output parser to handle pretty-printed multi-line JSON in addition to the single-line form.
  • Drops the unreachable setupMetadataFiles helper and two unused npm deps that were carried over from the env-action template.
  • Switches the CI integration job to a node-based integration-test.js (matching env-action) and ships a Pied Piper test .hx so hx deploy has project context.
  • Fills in OSS-readiness gaps for a public release: CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md adapted from Hyphen/nodejs-sdk, plus a copyright year on LICENSE.

Test plan

  • CI is green: lint, format check, unit tests (40 tests, ~99% coverage), check-dist, and codeql.
  • Integration test job succeeds on ubuntu-latest, windows-latest, and macos-latest against the Pied Piper test project.
  • Confirm the test .hx IDs map to a project with at least one deployable app; if not, swap in IDs from a project set up for deploy testing.
  • Verify SECURITY.md's reporting flow still matches Hyphen's current policy (vs. private vulnerability reporting).
  • Spot-check the action end-to-end in a downstream workflow against a real Hyphen project before tagging v1.

Adds a GitHub Action that wraps `hx deploy` with full flag parity,
blocks until the deployment finishes, and exposes structured outputs
(deployment-id, run-id, deployment-url, status, reason) parsed from
the CLI's --output json payload.

Mirrors the env-action layout: @actions/core + @actions/exec, jest +
ts-jest tests, @vercel/ncc bundle committed to dist/, and the standard
ci / check-dist / linter / codeql workflows.

Requires the hx release that ships `--output json` on `hx deploy`
(Hyphen/hx#259).
Neither was imported anywhere in src/ or __tests__/. They were copied
from the env-action template at scaffold time.
…cument run

setupMetadataFiles was only ever called with workspace === cloneLocation
(main passes getCloneLocation()'s return value), so its body past the
early return was unreachable. Remove the helper, its test, and the call
from main.

Also: read core.getInput('path') once in getCloneLocation, and add the
JSDoc on run() that env-action and setup-hx-action use.
The previous parser only matched a single line that both started with
'{' and ended with '}', so a pretty-printed JSON object from the CLI
would silently fail to set outputs. Walk lines from the bottom looking
for one that begins with '{' and JSON.parse from there to the end of
stdout, which handles single-line, multi-line, and preceded-by-noise
output.
…NSE year

- Add the reason output row to the README outputs table.
- Label the env-action step in the Usage example as optional, since
  deploy-action does not require it.
- Add a copyright year to LICENSE.
Replace the inline bash output assertions with a node script that reads
the step outputs via env vars, matching the pattern used by env-action.
Also commit a Pied Piper test .hx so hx deploy has project context in
the integration job.
Add a .devcontainer/devcontainer.json mirroring env-action and
setup-hx-action so contributors get the same Codespaces / VS Code
Dev Containers experience.

Stop committing the generated coverage badge; the npm run coverage
script still produces it locally on demand, matching the sibling repos.
Adapted from Hyphen/nodejs-sdk so the public OSS surface has the
expected community files.
- Switch action.yml branding icon from rocket to upload-cloud (rocket
  isn't in GitHub's allowed branding icon set, tripping actionlint).
- Demote secondary H1s in CONTRIBUTING.md to H2 and renumber the ordered
  list to match the project's MD029 'one' style.
- Wrap bare attribution URLs in CODE_OF_CONDUCT.md in <...> for MD034.
- Exempt tables and code blocks from MD013 line-length so the README's
  input/output tables stop tripping the lint check.
- Replace terminology textlint flags: e-mail -> email, repo -> repository,
  git -> Git, Github -> GitHub.
The integration-tests job runs hx deploy against a Pied Piper test
project that maintainers don't have shared access to, so the job fails
on every PR with an unauthorized error from the dev API. Drop the job,
the test .hx fixture, and the integration-test.js assertion runner so
CI is green by default.

Add a Releasing section to CONTRIBUTING.md noting that maintainers
should run the action end-to-end against a real Hyphen project before
tagging a release, since CI no longer covers that path.

Also remove the README's 'Validate the Action' section that documented
the integration-test workflow pattern, and the .eslintignore entry for
the deleted integration-test.js.
@actions/core 1.x and 2.x both transitively pull undici 5.x via
@actions/http-client, which carries five high/moderate advisories
(request smuggling, websocket decompression DoS, CRLF injection, etc.).
The fix only lands in @actions/core 3.x, which is ESM-only — that's a
much larger lift than this action needs.

Pin undici to ^6.23.0 via npm overrides instead. The override applies
through @actions/http-client 2.x; tests still pass and `npm audit
--omit=dev` is clean. The remaining audit findings are dev-only
(prettier-eslint -> @typescript-eslint -> minimatch) and never ship in
dist/.

Rebuild dist/ to pick up the new undici.
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

The action's outputs (deployment-id, run-id, deployment-url, status,
reason) are useful for downstream steps but don't surface anywhere in
the GitHub Actions run-summary panel. This adds a short summary written
via core.summary so consumers can click straight from the run page to
the deployment in the Hyphen dashboard.

The summary contains the deployment status, the failure reason (when
present), and a link to the dashboard run.
@half-ogre half-ogre merged commit d9a392d into main Apr 27, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants