Guides / Use GitHub actions in steps
Use GitHub actions in steps
A uses: step runs a GitHub action, the same as in a GitHub
workflow. Checkout, language setup, caching and most Marketplace
actions carry over unchanged.
Prerequisites
Section titled “Prerequisites”- The action’s
owner/repo@ref, from its Marketplace page or README.
-
Add a uses step
Section titled “Add a uses step”.hatchrun/config.yml jobs:build:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v5- uses: actions/setup-go@v5with:go-version: '1.25'- run: go build ./...hatchrun fetches the action from GitHub at the ref you name.
-
Pass inputs with with
Section titled “Pass inputs with with”withholds the action’s inputs. Values can hold expressions:.hatchrun/config.yml jobs:upload:runs-on: ubuntu-lateststeps:- uses: actions/upload-artifact@v4with:name: report-${{ github.sha }}path: reports/retention-days: 7 -
Read an action’s outputs
Section titled “Read an action’s outputs”Give the step an
id. Later steps read its outputs as${{ steps.ID.outputs.NAME }}:.hatchrun/config.yml jobs:tag:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v5- id: metauses: docker/metadata-action@v5with:images: ghcr.io/my-org/app- run: echo "${{ steps.meta.outputs.tags }}" -
Pin the ref
Section titled “Pin the ref”Pin third-party actions to a full commit SHA. A tag such as
v5can be moved to new code; a SHA cannot:.hatchrun/config.yml jobs:build:runs-on: ubuntu-lateststeps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 -
Validate
Section titled “Validate”Terminal window hatchrun validate
What works
Section titled “What works”| Action type | Status |
|---|---|
| JavaScript actions | At launch |
| Composite actions | At launch |
Local actions, uses: ./path |
At launch |
| Docker container actions | A later release |
uses: docker://image |
Not supported yet; an error |
The machine provides the github context and the GITHUB_*
variables and files that actions expect, such as GITHUB_OUTPUT and
GITHUB_ENV.
Keys a uses step takes
Section titled “Keys a uses step takes”uses, with, name, id, env, if and continue-on-error.
shell, working-directory and timeout-minutes belong to run:
steps only.