Let’s Get Certified
Module 09 / 15 · Custom action development

Define inputs, entry points and observable outputs

Connect an action's metadata to its executable, map inner step outputs and make validation failures visible to callers.

A computed value never leaves the action

The inner scan step writes count=4 to GITHUB_OUTPUT, but callers see an empty result. Which named links should the maintainer trace?

Work through the decision

Check the inner step ID, the declared composite output's value expression, the caller's action-step ID and the final output key. Test with a fixed fixture whose expected count is four. Writing the number to the job summary would only fix what the human can see.

Describe the action contract

An action.yml or action.yaml in the referenced directory declares its name, description, inputs, outputs and runs implementation. JavaScript metadata points to its entry file. Composite steps that use run must specify an appropriate shell. Document defaults and validate required values in the implementation.

Expose action results

Workflow commands and environment files communicate with the runner. Write a step's simple outputs to GITHUB_OUTPUT. Expose a composite output through its metadata by referencing the identified inner step. For a JavaScript action, the Actions toolkit can set outputs and signal failure.

In a composite action, the public result maps to the output of an identified step. The caller reads steps.<caller-step-id>.outputs.count. This fragment returns a fixed fixture value of four.

name: Count fixture
description: Return a known count for an interface test
outputs:
  count:
    description: Number of rows
    value: ${{ steps.measure.outputs.count }}
runs:
  using: composite
  steps:
    - id: measure
      shell: bash
      run: echo "count=4" >> "$GITHUB_OUTPUT"

A warning passes the build

A JavaScript validator catches an error, prints a warning and returns normally. The deployment remains eligible. How should the author make a failed validation actionable?

Check your reasoning

Signal a nonzero outcome or use the toolkit failure method. Include a short safe diagnostic, then verify the caller does not mask failure through continue-on-error. Test a valid fixture and one intentionally invalid fixture before release.

GitHub documentation · GH-200 skills outline

Continue in GitHub Foundations. Set up a repository others can maintain.

Knowledge check

Define inputs, entry points and observable outputs quiz

Answer 5 questions. Check each answer for an explanation.