From 9f78edceac6bd7cbdc881cc7a1a4a4cc494afd8b Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Mon, 19 Oct 2026 18:41:15 +0200 Subject: [PATCH] fix(linter): skip commitlint by default on scheduled and manual runs --- .github/workflows/linter.md | 5 ++++- .github/workflows/linter.yml | 12 ++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linter.md b/.github/workflows/linter.md index 6867f85..0e462a4 100644 --- a/.github/workflows/linter.md +++ b/.github/workflows/linter.md @@ -67,7 +67,10 @@ strings to use Super-Linter's native `VALIDATE_*=true` allowlist, including commitlint. Do not mix `true` and `false` validator flags in that mode. CI uses Git change detection according to `lint-all` and publishes GitHub -summaries. Local runs use filesystem discovery by default. The workflow also +summaries. Scheduled (`schedule`) and manual (`workflow_dispatch`) runs disable +commitlint by default because these events do not provide a commit range. +Explicit `linter-env` validator settings take precedence. +Local runs use filesystem discovery by default. The workflow also installs project dependencies when `package.json` declares Prettier plugins; install those dependencies before running the image locally. diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6ffbf0d..b3a05de 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -114,6 +114,18 @@ jobs: environment.set(key, line.slice(separatorIndex + 1)); } + // These events have no commit range for commitlint to validate. + // FIXME: https://github.com/super-linter/super-linter/issues/7968 + if (["schedule", "workflow_dispatch"].includes(context.eventName)) { + // An allowlist already excludes commitlint unless explicitly enabled. + const hasValidatorAllowlist = [...environment].some(([key, value]) => + key.startsWith("VALIDATE_") && key !== "VALIDATE_ALL_CODEBASE" && value.toLowerCase() === "true" + ); + if (!environment.has("VALIDATE_GIT_COMMITLINT") && !hasValidatorAllowlist) { + environment.set("VALIDATE_GIT_COMMITLINT", "false"); + } + } + for (const [key, value] of environment) { core.exportVariable(key, value); }