Add buildx outputs and build-contexts inputs #2

Merged
stephen merged 2 commits from feat/1-outputs-build-contexts into main 2026-06-17 00:45:35 +00:00
Owner

What changed

Adds first-class outputs and build-contexts inputs so multi-output and monorepo/multi-context buildx workflows no longer need extra-args. Closes #1.

  • outputs: newline list mapped to buildx --output (one exporter spec per line, e.g. type=local,dest=out, type=tar,dest=img.tar).
  • build-contexts: newline list mapped to --build-context name=ref (path, image, git URL, or another stage).
  • Both go through the existing quoted per-line path, so no shell word splitting; build-contexts entries are validated as name=ref and reject anything else.
  • Documented in action.yml, README (with examples), MIGRATION (the outputs row is now first-class instead of pointing at extra-args), and CHANGELOG. Existing inputs unchanged.

How it was tested

  • make lint clean (shellcheck; shfmt/actionlint/yq not installed locally, skipped)
  • make test green: new cases cover single value, multiple values, empty = flag omitted, and a malformed build-context rejection
**What changed** Adds first-class `outputs` and `build-contexts` inputs so multi-output and monorepo/multi-context buildx workflows no longer need `extra-args`. Closes #1. - `outputs`: newline list mapped to buildx `--output` (one exporter spec per line, e.g. `type=local,dest=out`, `type=tar,dest=img.tar`). - `build-contexts`: newline list mapped to `--build-context name=ref` (path, image, git URL, or another stage). - Both go through the existing quoted per-line path, so no shell word splitting; `build-contexts` entries are validated as `name=ref` and reject anything else. - Documented in `action.yml`, README (with examples), MIGRATION (the `outputs` row is now first-class instead of pointing at `extra-args`), and CHANGELOG. Existing inputs unchanged. **How it was tested** - [x] `make lint` clean (shellcheck; shfmt/actionlint/yq not installed locally, skipped) - [x] `make test` green: new cases cover single value, multiple values, empty = flag omitted, and a malformed build-context rejection
Add outputs and build-contexts inputs
Some checks failed
test / e2e (pull_request) Failing after 4s
test / unit (pull_request) Successful in 4s
1ccfd19ae7
Map a newline-list `outputs` input to buildx `--output` and a
`build-contexts` input to `--build-context name=ref`, bringing the
action to parity with docker/build-push-action for multi-output and
monorepo/multi-context builds. Both go through the quoted per-line
path (no shell word splitting); build-context entries are validated as
name=ref. Existing inputs are unchanged.

Docs updated in action.yml, README, and MIGRATION; offline tests cover
single, multiple, empty-omitted, and the malformed build-context case.
Make the e2e CI job inert when Docker is unavailable
All checks were successful
test / e2e (pull_request) Successful in 4s
test / unit (pull_request) Successful in 21s
303ee3767a
The e2e job needs docker + buildx on the runner; runners without them
failed the job for a missing prerequisite (pre-existing on main, not
specific to any one change). Add a preflight check that, when Docker is
absent, prints "e2e skipped: docker not available on this runner" and
passes, mirroring how the action skips login when no token is set. The
real build and assert steps are unchanged and still run wherever Docker
is present, so a green job never silently hides that e2e ran.
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
rasterstate/docker-build-action!2
No description provided.