From f0b606994f19ff43e3d0b0d19c029bf9a69d72be Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Tue, 14 Jul 2026 11:16:40 -0700 Subject: [PATCH] [EngSys] Lint workflows with actionlint --- .github/actionlint.yaml | 8 ++++++++ .github/matchers/actionlint.json | 17 ++++++++++++++++ .github/workflows/actionlint.yml | 35 ++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .github/actionlint.yaml create mode 100644 .github/matchers/actionlint.json create mode 100644 .github/workflows/actionlint.yml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 000000000000..4cfa6aa47201 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,8 @@ +paths: + .github/workflows/*.lock.yml: + ignore: + - ".+" + +self-hosted-runner: + labels: + - 1ES.Pool=azsdk-pool-github-runners diff --git a/.github/matchers/actionlint.json b/.github/matchers/actionlint.json new file mode 100644 index 000000000000..4613e1617bfe --- /dev/null +++ b/.github/matchers/actionlint.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "actionlint", + "pattern": [ + { + "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$", + "file": 1, + "line": 2, + "column": 3, + "message": 4, + "code": 5 + } + ] + } + ] +} diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml new file mode 100644 index 000000000000..1bd951bbdfa5 --- /dev/null +++ b/.github/workflows/actionlint.yml @@ -0,0 +1,35 @@ +name: Actionlint + +on: + push: + branches: + - main + paths: + - .github/** + pull_request: + paths: + - .github/** + workflow_dispatch: + +permissions: + contents: read + +jobs: + actionlint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + sparse-checkout: | + .github + + # Content copied from https://raw.githubusercontent.com/rhysd/actionlint/2ab3a12c7848f6c15faca9a92612ef4261d0e370/.github/actionlint-matcher.json + - name: Add ActionLint Problem Matcher + run: echo "::add-matcher::.github/matchers/actionlint.json" + + - name: Lint workflows + uses: docker://rhysd/actionlint:1.7.12@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 + with: + args: -color -verbose