Skip to main content
Every custom GitHub Action must include a metadata file (action.yml or action.yaml) in the repository root. This file defines how GitHub recognizes, configures, and runs your Action.
The metadata file name must be either action.yml or action.yaml and live at the root of your Action’s repository.

Key Definitions

Basic Metadata Example

Inputs and Outputs

  • inputs
    Define each parameter with:
    • description (required)
    • required (boolean)
    • Optional: default, deprecationMessage
  • outputs
    Define each output with:
    • description (required)

JavaScript Action Metadata

Use this pattern when your Action runs on Node.js:
  • using: Node runtime version
  • main: Primary entrypoint file
  • pre / post: Setup and teardown scripts
  • pre-if / post-if: Conditions for running pre/post scripts

Docker Container Action Metadata

Container Actions package dependencies in a Docker image:
  • using: Must be docker
  • image: Path to Dockerfile or registry image
  • args: Array of arguments passed to the container
  • pre-entrypoint / post-entrypoint: Hooks around the container’s entrypoint

Composite Action Metadata

Composite Actions let you chain shell commands and other Actions:
  • using: Must be composite
  • steps: List of step objects, each with run or uses
  • Optional: shell to specify interpreter

Action Types Comparison


Watch Video

Practice Lab