Skip to content

chore: upgrade trunk linters (#257) #269

chore: upgrade trunk linters (#257)

chore: upgrade trunk linters (#257) #269

Workflow file for this run

name: Lint
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
concurrency:
# Cancel superseded PR runs to save CI minutes; let push/main runs finish so
# main is always validated directly (catches anything pushed straight to main).
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
mago:
name: Mago (PHP lint + format check)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: "8.4"
tools: composer:v2
- name: Cache Composer packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.composer/cache/files
key: ${{ runner.os }}-composer-lint-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-lint
- name: Install dev dependencies
run: composer install --no-interaction --no-progress
- name: Mago lint
run: vendor/bin/mago lint
- name: Mago format check
run: vendor/bin/mago fmt --dry-run
trunk:
name: Trunk Check (yaml, markdown, shell, actions, …)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# save-annotations stores findings as an artifact instead of posting them
# to the GitHub Checks API. That avoids the *second* check-run that used to
# duplicate this job's red status — and the 403 it would otherwise throw
# without `checks: write`. Findings still print in the job log and fail
# this job via its exit code; grant `checks: write` + drop this only if you
# want inline PR annotations (and the extra check-run) back.
- name: Trunk Check
uses: trunk-io/trunk-action@e1234e67a86010d61ddac8d8ebf4b783e2ffd2fa # v2.0.0
with:
save-annotations: true