Setup Mago is a GitHub action that provides a cross-platform interface for setting up the Mago CLI in GitHub Actions runners.
The following inputs are supported.
- name: Setup Mago uses: nhedger/setup-mago@v1 with: # The version of the Mago CLI to install. # This input is optional and by default the version will be automatically # detected from the project's dependencies. If no version is found in the # project's dependencies, the latest version of the Mago CLI will be installed. # Example values: "0.7.0", "latest" version: "" # The GitHub token to use to authenticate GitHub API requests. # This input is optional and defaults to the job's GitHub token. # Example value: ${{ secrets.GITHUB_TOKEN }} token: ${{ github.token }} # The directory in which the composer.lock will be looked for when automatically # determining the version of the Mago CLI to install. Defaults to the current # working directory. working-directory: ""To automatically determine the version of Mago to install based on the project's dependencies, omit the version input.
The action will look for the version of the carthage-software/mago dependency in the composer.lock. If the version cannot be found in the lockfile, the action will install the latest version of the Mago CLI.
- name: Setup Mago uses: nhedger/setup-mago@v1 - name: Run Mago run: mago lint --reporting-format=githubSetup the latest version of the Mago CLI.
- name: Setup Mago CLI uses: nhedger/setup-mago@v1 with: version: latest - name: Run Mago run: mago lint --reporting-format=githubInstall version 0.7.0 of the Mago CLI.
- name: Setup Mago CLI uses: nhedger/setup-mago@v1 with: version: 0.7.0 - name: Run Mago run: mago lint --reporting-format=githubCopyright © 2025, Nicolas Hedger. Released under the MIT License.