Skip to content

feat: add action.yml - #16

Merged
doc-han merged 3 commits into
mainfrom
composite-action
Sep 11, 2026
Merged

doc-han merged 3 commits into
mainfrom
composite-action

Conversation

@doc-han

@doc-han doc-han commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

What this does

Turns this repo into something Lightning and kit can call directly from their
own CI, so a breaking change on either side shows up on the PR that
introduced it — not just on a manual dispatch here
(lightning#4784's original
ask). action.yml is a composite action wrapping the same
prep-and-run sequence the dispatch workflow already did: resolve the specs,
install the toolchain the Lightning checkout pins, boot the pair, run the
suite, upload logs.

The dispatch workflow (test-lightning-branch.yml)
now calls that action (uses: ./) instead of duplicating its steps, so it
doubles as the action's own test.

How to use and test it

bun run typecheck
bun src/cli.ts resolve --lightning ../lightning --worker ../kit   # prints {lightning, worker} JSON

Not yet run through a real uses: OpenFn/kit-lightning-integration@... call
from another repo — that needs a push and a tag (see reviewer guide). Checked
so far: both YAML files parse, actionlint reports no findings on the
workflow, and resolve produces clean JSON on stdout for a local path, a
bare ref (triggers a clone), and the owner/repo#ref form the workflow
itself now passes.

Where to look, in order

  1. action.yml — start here; the header comment is the spec
    (the two caller snippets, the two requirements: caller provides Postgres,
    Linux runner).
  2. src/cli.ts — new resolve subcommand: turns a spec into
    a checkout (cloning if needed) without booting anything, prints
    {lightning, worker} as JSON. This is the seam the action needed — it has
    to know where .tool-versions lives before it can install the
    toolchain, which the old workflow only solved by hardcoding
    actions/checkout into .cache/lightning itself.
  3. src/source.ts — one-line change: the fetch-progress
    log moved to stderr, so resolve's stdout stays clean JSON for the
    action's jq to parse.
  4. test-lightning-branch.yml
    — collapsed to checkout + Postgres service + uses: ./, passing
    owner/repo#ref for the action to resolve itself.
  5. README.md — new "Using it from another repo" section with
    the caller snippet and the @v1-not-@main pinning note.

@doc-han
doc-han merged commit f71be47 into main Sep 11, 2026
1 check 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