From 0e91b11608747736fbd341934d56e3a3b94be547 Mon Sep 17 00:00:00 2001 From: Matt Godbolt Date: Fri, 10 Jul 2026 16:15:31 -0500 Subject: [PATCH] Lint GitHub Actions workflows with actionlint Part of an org-wide rollout: statically checks workflow files (schema, expression contexts, runner labels, shellcheck over run: scripts) on any push/PR touching them. Co-Authored-By: Claude Fable 5 --- .github/actionlint.yaml | 18 ++++++++++++++++++ .github/workflows/lint-actions.yml | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/actionlint.yaml create mode 100644 .github/workflows/lint-actions.yml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..f8905c9 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,18 @@ +self-hosted-runner: + # Labels of Compiler Explorer's self-hosted runners (see the ce-ci repository) + labels: + - ce + - small + - medium + - admin + - lin-builder + - win-builder + +# Enforce shellcheck errors and warnings in embedded run: scripts, but not +# info/style — consistent with the org-wide actionlint rollout. +paths: + .github/workflows/**/*.yml: + ignore: &shellcheck-info-style + - 'shellcheck reported issue in this script: SC\d+:(info|style):' + .github/workflows/**/*.yaml: + ignore: *shellcheck-info-style diff --git a/.github/workflows/lint-actions.yml b/.github/workflows/lint-actions.yml new file mode 100644 index 0000000..1b8c9e8 --- /dev/null +++ b/.github/workflows/lint-actions.yml @@ -0,0 +1,20 @@ +name: Lint GitHub Actions workflows + +on: + push: + branches: [main] + paths: ['.github/workflows/**', '.github/actionlint.yaml'] + pull_request: + paths: ['.github/workflows/**', '.github/actionlint.yaml'] + +jobs: + actionlint: + if: github.repository_owner == 'compiler-explorer' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check workflow files + uses: docker://rhysd/actionlint:1.7.12 + with: + args: -color