Setup Mago integrates into any GitHub Actions workflow in minutes. By default you need nothing more than a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nhedger/setup-mago/llms.txt
Use this file to discover all available pages before exploring further.
uses: line — the action reads your composer.lock to detect the right Mago version and places the mago binary on the runner’s PATH, ready to use in the very next step. The guide below walks you from a minimal snippet to a complete, production-ready lint workflow.
Add the action to your workflow
The simplest possible setup omits every input. The action will look for The
carthage-software/mago in your composer.lock, and install that version automatically. If no entry is found, it falls back to the latest stable release.--reporting-format=github flag emits annotations directly in the GitHub Actions UI, highlighting lint violations inline on the diff.The action uses the GitHub API to resolve and download Mago releases. By
default it authenticates with the job’s built-in
GITHUB_TOKEN. In
repositories with very high workflow concurrency, you may hit the anonymous
API rate limit — pass an explicit token input to avoid this:Choose a version
Automatic detection (recommended) — omit the Explicit version — pin a specific release when you want full control over upgrades, regardless of what’s in your Composer files:Latest version — always install the newest stable release:
version input and the action resolves the version for you using the following priority order:- The
versioninput, if provided. - The version of
carthage-software/magopinned incomposer.lock. - The version constraint in
composer.json(require-devorrequire). - The latest stable release as a final fallback.
composer.lock or composer.json lives in a subdirectory, point the action to it with working-directory:Run Mago commands
Once the action completes, the On Windows runners the same commands work without modification — Setup Mago downloads the correct
mago binary is available on the PATH for all subsequent steps in the job. Use it like any locally-installed CLI tool:.zip archive and installs the mago.exe binary transparently.Complete Workflow Example
The workflow below puts all three steps together in a realistic CI pipeline. It triggers on every push and pull request, checks out the code, installs Mago using the version fromcomposer.lock, and runs the linter with GitHub-native annotations.
.github/workflows/lint.yaml in your repository. From the next push onward, every pull request will display Mago lint annotations directly on the changed files.