Skip to content

Bootstrap heal-trigger as a production-ready GitHub Action in TypeScript#1

Merged
wbeuil merged 7 commits intomainfrom
copilot/create-github-action-repo
Feb 25, 2026
Merged

Bootstrap heal-trigger as a production-ready GitHub Action in TypeScript#1
wbeuil merged 7 commits intomainfrom
copilot/create-github-action-repo

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 25, 2026

Implements the heal-dev/heal-trigger GitHub Action: triggers a Heal.dev test execution via the backend API and surfaces the execution URL in the workflow run.

Action

  • action.yml — inputs: api-token (required), team, feature, test-case, backend-url (default: https://backend.heal.dev); output: url; node24 runner, purple/zap branding
  • src/index.ts — async run() POSTs to /api/v1/executions/trigger with a Bearer token; builds filter body from optional inputs; logs and outputs healExecutionUrl from the response; all errors routed through core.setFailed()
  • src/utils.tsglobToRegex() converts glob patterns (*nance, *login*) to POSIX regex strings compatible with PostgreSQL's ~* operator used by the backend
  • src/types.tsTriggerExecutionRequest and ExternalExecutionTriggeredResponse typed from the OpenAPI spec
  • dist/index.js — pre-built bundle committed to repo (ncc compiles TypeScript directly; no install required at action runtime)

Tooling

  • TypeScript (typescript, @types/node) — strict, node24 target
  • Vitest — 11 tests covering glob conversion, filter wiring, custom backend URL, HTTP error handling, and network failures
  • OxLint + OxFmt for lint/format
  • Lefthook — pre-commit hook running lint, format check, typecheck, and tests
  • package.json scripts: test, lint, lint:fix, format, format:check, typecheck, build

CI/CD

  • ci.yml — runs on push/PR: npm ci → oxlint → oxfmt --check → typecheck → vitest → ncc build → git diff guard on dist/ to catch uncommitted bundle changes; concurrency group cancels in-progress runs
  • release.yml — triggered on v* tags: builds dist, creates GitHub Release with auto-generated notes, force-updates floating major tag (e.g. v1)

Usage

name: Heal.dev CI
on:
  push:

jobs:
  heal-dev:
    name: Heal.dev
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Heal Suite Execution
        uses: heal-dev/heal-trigger@v1
        with:
          api-token: ${{ secrets.HEAL_API_TOKEN }}
          team: "*nance"        # optional glob filter
          feature: decision-analysis
          test-case: "*login*"

…flows

Co-authored-by: wbeuil <8110579+wbeuil@users.noreply.github.com>
Copilot AI changed the title [WIP] Create new GitHub Action repository structure in JavaScript Bootstrap heal-trigger as a production-ready GitHub Action Feb 25, 2026
@wbeuil
Copy link
Copy Markdown
Contributor

wbeuil commented Feb 25, 2026

@copilot

Update this PR to convert the entire codebase from JavaScript to TypeScript:

Changes Required

Source Files

  • Rename src/index.jssrc/index.ts and src/utils.jssrc/utils.ts
  • Add proper TypeScript types to all functions, parameters, and return values
  • Type the @actions/core and @actions/github usage properly

Tests

  • Rename __tests__/index.test.js__tests__/index.test.ts
  • Update Vitest config to handle TypeScript (use vitest.config.ts instead of vitest.config.js)

TypeScript Config

  • Add tsconfig.json with strict mode enabled, targeting ES2022, moduleResolution node, outDir ./lib
  • Source files in src/, tests excluded from build but included in type checking

Build Pipeline

  • Update the ncc build command to compile from src/index.ts directly (@vercel/ncc supports TypeScript out of the box, no separate tsc step needed)
  • The output remains dist/index.js

Package Updates

  • Add typescript as a devDependency
  • Add @types/node as a devDependency
  • Update package.json scripts if needed (ncc build should point to src/index.ts)

CI Workflow

  • Ensure CI still runs: oxlint, oxfmt --check, vitest run, ncc build, dist/ diff guard
  • OxLint and OxFmt support TypeScript files natively, just make sure the commands target .ts files

What NOT to Change

  • Keep action.yml as-is (still points to dist/index.js)
  • Keep OxLint/OxFmt configs (.oxlintrc.json, .oxfmtrc.json) — just ensure they cover .ts files
  • Keep the same test coverage and action logic (greet example)
  • Keep the release workflow unchanged

Convert all files and ensure everything builds and passes cleanly.

Co-authored-by: wbeuil <8110579+wbeuil@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 25, 2026

@copilot

Update this PR to convert the entire codebase from JavaScript to TypeScript:
...

Done in commit 5c3a1af. Here's what changed:

  • src/index.jssrc/index.ts — typed inputs/outputs, unknown error handling in catch
  • src/utils.jssrc/utils.ts — typed function signatures (string params/returns)
  • __tests__/index.test.js__tests__/index.test.ts — uses vi.mocked() for type-safe mock setup, import paths updated (no .js extension)
  • vitest.config.jsvitest.config.ts
  • Added tsconfig.json — strict mode, ES2022 target, CommonJS module, node moduleResolution, outDir: ./lib, includes both src/ and __tests__/ for type checking
  • package.json — build script now points to src/index.ts, added typescript and @types/node devDependencies
  • dist/index.js rebuilt from the TypeScript source (ncc uses local typescript@5.9.3 natively)

All checks pass: tsc --noEmit (zero errors), oxlint (0 warnings/errors), oxfmt --check (all files correctly formatted), vitest run (8/8 tests pass).

Copilot AI changed the title Bootstrap heal-trigger as a production-ready GitHub Action Bootstrap heal-trigger as a production-ready GitHub Action in TypeScript Feb 25, 2026
wbeuil and others added 2 commits February 25, 2026 15:10
Replace the hello-world scaffold with the real Heal.dev CI action.

- POST to /api/v1/executions/trigger on backend.heal.dev (overridable via backend-url input)
- Inputs: api-token (required), team, feature, test-case (optional glob filters), backend-url
- Glob filters converted to POSIX regex compatible with PostgreSQL ~* operator
- Outputs the healExecutionUrl returned by the API
- Add src/types.ts with TriggerExecutionRequest and ExternalExecutionTriggeredResponse
- Drop @actions/github dependency (unused)
- Add lefthook pre-commit hook (lint, format:check, typecheck, test)
- Update README with usage, filter examples, and correct inputs/outputs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wbeuil wbeuil marked this pull request as ready for review February 25, 2026 15:11
@wbeuil wbeuil requested review from PierreOucif and Copilot and removed request for Copilot February 25, 2026 15:14
PierreOucif
PierreOucif previously approved these changes Feb 25, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wbeuil wbeuil merged commit af15814 into main Feb 25, 2026
1 check passed
@wbeuil wbeuil deleted the copilot/create-github-action-repo branch February 25, 2026 15:32
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.

3 participants