Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Lint Github Actions Workflows with actionlint (#77698)

Chris Vandoodewaardbd6c7a3ef66e
diff --git a/.github/file-paths.yaml b/.github/file-paths.yaml
index 0734e924531..f264d6d3a56 100644
--- a/.github/file-paths.yaml
+++ b/.github/file-paths.yaml
@@ -7,6 +7,10 @@ default: &default
- "locales/**"
- "bin/**/!(*.md)"
+actionlint:
+ - ".github/workflows/*.yml"
+ - ".github/workflows/*.yaml"
+
shared_sources: &shared_sources
- "src/**/*.cljc"
- "src/**/*.cljs"
diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml
new file mode 100644
index 00000000000..26a349b258d
--- /dev/null
+++ b/.github/workflows/actionlint.yml
@@ -0,0 +1,42 @@
+name: Actionlint
+
+on:
+ push:
+ branches:
+ - 'master'
+ - 'release-**'
+ paths:
+ - '.github/workflows/**'
+ pull_request:
+ paths:
+ - '.github/workflows/**'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ actionlint:
+ name: Lint Github Actions Workflows
+ runs-on: ${{ vars.DEFAULT_RUNNER_KEY }}
+ steps:
+ - uses: actions/checkout@v6
+ - name: Get changed Github actions
+ uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
+ id: changes
+ with:
+ token: ${{ github.token }}
+ filters: .github/file-paths.yaml
+ list-files: shell
+ - name: Setup actionlint
+ id: download
+ shell: bash
+ run: |
+ if command -v actionlint; then
+ echo "executable=actionlint" >> "$GITHUB_OUTPUT"
+ else
+ # script sets executable output, for details see: https://github.com/rhysd/actionlint/blob/main/docs/usage.md#use-actionlint-on-github-actions
+ bash <(curl -fsSL https://raw.githubusercontent.com/rhysd/actionlint/v1.7.12/scripts/download-actionlint.bash)
+ fi
+ - name: Run actionlint
+ run: ${{ steps.download.outputs.executable }} --color --verbose ${{ steps.changes.outputs.actionlint_files }}
diff --git a/mise.toml b/mise.toml
index 5b97ae845d4..6f37d2ac58e 100644
--- a/mise.toml
+++ b/mise.toml
@@ -113,3 +113,7 @@ op = "latest"
# jq - Command-line JSON processor
# https://github.com/jqlang/jq
jq = "latest"
+
+# actionlint - Linting for Github Actions workflows
+# https://github.com/rhysd/actionlint
+actionlint = "latest"