Every custom GitHub Action must include a metadata file (Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Key | Required | Description |
|---|---|---|
| name | Yes | The display name in the GitHub Actions UI. |
| description | Yes | A brief summary of what the Action does. |
| author | No | The creator’s name or handle. |
| branding | No | Icon and color badge shown next to the Action name. |
| inputs | No | Parameters accepted by the Action at runtime. |
| outputs | No | Values produced by the Action for downstream steps. |
| runs | Yes | Specifies how to execute the Action (JavaScript, Docker, or Composite). |
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 versionmain: Primary entrypoint filepre/post: Setup and teardown scriptspre-if/post-if: Conditions for running pre/post scripts
Docker Container Action Metadata
Container Actions package dependencies in a Docker image:using: Must bedockerimage: Path toDockerfileor registry imageargs: Array of arguments passed to the containerpre-entrypoint/post-entrypoint: Hooks around the container’s entrypoint
Composite Action Metadata
Composite Actions let you chain shell commands and other Actions:using: Must becompositesteps: List of step objects, each withrunoruses- Optional:
shellto specify interpreter
Action Types Comparison
| Action Type | using | Entrypoint | Common Use Case |
|---|---|---|---|
| JavaScript | node16…20 | main, pre/post | Custom logic in Node.js |
| Docker | docker | image, args | Containerized tools and runtimes |
| Composite | composite | steps | Shell scripts or combining Actions |
Links and References
- GitHub Actions Metadata Syntax
- Creating a JavaScript Action
- Implementing a Docker Container Action
- Composite Run Steps Action