docs/current_docs/adopting/triggers/github-actions.mdx
Dagger provides a GitHub Action that runs dagger check in any GitHub Actions workflow, so the same checks you run locally run on every push — without rewriting your pipeline.
:::tip
For checks with no workflow YAML at all, enable Cloud Checks with dagger ws autocheck on. The GitHub Action below is the hybrid-mode alternative for when you want to drive Dagger from your existing GitHub Actions setup.
:::
dagger/dagger-for-github action.dagger check against the modules installed in your workspace..dagger/config.toml) — see Workspace Setup.Run all checks on every push and pull request:
name: dagger
on:
push:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Dagger checks
uses: dagger/[email protected]
with:
check: "**"
version: "latest"
The check input takes the same patterns as the CLI, so you can scope it — for example check: "go:*" to run a single module's checks. As a convenience for the common case, the dagger/checks action wraps this step.
To send traces to Dagger Cloud and offload execution to a managed Dagger Engine, add your Cloud token:
https://dagger.cloud/{Your Org Name}/settings?tab=Tokens).DAGGER_CLOUD_TOKEN, and paste the token.cloud-token input: - name: Run Dagger checks
uses: dagger/[email protected]
with:
check: "**"
version: "latest"
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
By default the action starts a Dagger Engine inside the GitHub Actions runner. For a faster, more reliable experience, offload execution to a managed Dagger Engine provided by Dagger Cloud by adding --cloud to dagger-flags:
- name: Run Dagger checks
uses: dagger/[email protected]
with:
check: "**"
version: "latest"
cloud-token: ${{ secrets.DAGGER_CLOUD_TOKEN }}
dagger-flags: "--cloud"
Cloud Engines provide a large persistent cache shared across runs and far more compute than a GitHub Actions runner, so checks are typically much faster — and you don't provision or maintain any infrastructure. This requires the DAGGER_CLOUD_TOKEN secret configured above.
When using SSH keys in GitHub Actions, ensure proper SSH agent setup:
- name: Set up SSH
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< '${{ secrets.SSH_PRIVATE_KEY }}'
Replace ${{ secrets.SSH_PRIVATE_KEY }} with your provider secret containing the private key.
If you have any questions about additional ways to use GitHub with Dagger, join our Discord and ask your questions in our GitHub channel.
GitHub is a popular Web-based platform used for version control and collaboration. It allows developers to store and manage their code in repositories, track changes over time, and collaborate with other developers on projects.