Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
settings

GitHub Action

Mage Action

v2.2.0

Mage Action

settings

Mage Action

GitHub Action for Mage, a Make/rake-like build tool using Go

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Mage Action

uses: magefile/[email protected]

Learn more about this action in magefile/mage-action

Choose a version

Mage Logo

Mage Action

GitHub Action for Mage

GitHub release GitHub marketplace Test workflow Codecov Become a sponsor


Mage Action

Usage

name: mage

on:
  pull_request:
  push:

jobs:
  mage:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v3
      -
        name: Set up Go
        uses: actions/setup-go@v3
        with:
          go-version: 1.14
      -
        name: Run Mage
        uses: magefile/mage-action@v2
        with:
          version: latest
          args: build

For detailed instructions please follow GitHub Actions workflow syntax.

Customizing

inputs

Following inputs can be used as step.with keys

Name Type Default Description
version String latest Mage version. Example: v1.9.0
args String Arguments to pass to Mage
workdir String . Working directory (below repository root)

Using on GHES

If you specify a version or latest of GoReleaser in your workflow, the version will be downloaded from GitHub Releases in magefile/mage repository. These calls to magefile/mage are made via unauthenticated requests, which are limited to 60 requests per hour per IP.

If more requests are made within the time frame, then you will start to see rate-limit errors during downloading that looks like:

##[error]API rate limit exceeded for...

To get a higher rate limit, you can generate a personal access token on github.com and pass it as the github_token input for the action:

uses: magefile/mage-action@v2
with:
  github_token: ${{ secrets.GH_DOTCOM_TOKEN }}
  version: v1.14.0

If the runner is not able to access github.com, it will take the default one available on the GitHub Runner or runner's tool cache. See "Setting up the tool cache on self-hosted runners without internet access" for more information.

License

MIT. See LICENSE for more details.