All posts

Maester GitHub Action v2: what to change for Maester 3

Version 2 of the Maester GitHub Action runs Maester 3. If you run Maester from GitHub Actions, here is what your workflow runs today and the one-line change to make.

With Maester 3.0 out, we have released version 2 of the Maester GitHub Action. It runs Maester 3 by default.

If you run Maester from GitHub Actions, take two minutes to check your workflow. For most of you it’s a one-line change.

Look at the uses: line in your workflow file. The table shows what each one runs with maester_version: latest (the default). On v1, an exact maester_version such as 2.3.0 selects Maester 2 instead. On v2, Maester 2 needs maester_major_version: "2", also when you pin an exact 2.x version; without it the action stops with an error.

Your workflow usesWhat it runs by defaultWhat to do
maester365/[email protected] (or older)Maester 3, through v1 of the action, which was written before Maester 3Move to @v2
maester365/maester-action@mainMaester 3, through v2 of the actionMove to @v2
maester365/maester-action@v2Maester 3Nothing

The first row surprises people. Pinning the action to v1.2.0 doesn’t pin Maester. With maester_version: latest, v1 installs the newest Maester release, and since 30 November that’s 3.0. But v1 was written for Maester 2: it still runs the Maester 2 setup steps and can’t use any of the new Maester 3 options. Moving to v2 fixes that.

  1. Change the uses: line to maester365/maester-action@v2.
  2. Remove include_public_tests (Maester 3 only; keep it if you stay on Maester 2). Maester 3 runs the built-in tests from the module, so this input no longer does anything.
  3. Check include_private_tests. It decides whether the action checks out your repository. Keep it (it defaults to true) if your repository has a maester-config.json or custom tests. Set it to false if the repository only holds the workflow file.
- name: Run Maester 🔥
uses: maester365/[email protected]
uses: maester365/maester-action@v2
with:
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
client_id: ${{ secrets.AZURE_CLIENT_ID }}
include_public_tests: true
include_private_tests: false

@v2 always points at the newest 2.x release of the action, so you get fixes without touching your workflow again. You only move to a new major version when you choose to.

If you use Dependabot for GitHub Actions, it will open the @v2 pull request for you. If you’re moving to Maester 3, remove include_public_tests in that same pull request. If you’re staying on Maester 2, keep it and add maester_major_version: "2" instead.

Use v2 of the action and set maester_major_version: "2". You’ll keep running the newest Maester 2.x release until you’re ready to switch. Keep the Maester 2 inputs you already use, such as include_public_tests. If your workflow pins an exact maester_version such as 2.3.0, it keeps running that release; set it to latest, or remove it, to get the newest 2.x.

uses: maester365/maester-action@v2
with:
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
client_id: ${{ secrets.AZURE_CLIENT_ID }}
maester_major_version: "2"

v2 adds inputs that use Maester 3’s features: skip_builtin_tests, test_ids, exclude_test_ids and config_path. It also installs Pester for you when your repository has Pester-format custom tests. The v2.0.0 release notes list every change.

Before you switch, read Upgrading from Maester 2.x. Try the change on a branch with workflow_dispatch first.

Questions? Ask us on Discord.

Release

Maester 3.0 is here

Maester 3.0 is now the stable release. 914 built-in tests, a brand new report that tells you what to fix first, and Maester Packs, with Microsoft's Zero Trust Assessment built in. Here's the story of how we got here, and where we're going next.

Merill Fernando10 min read