From 53f6e46eb31f711baeee8f1ff1f6f41dca280faf Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:29:07 +0800 Subject: [PATCH] style: skip actionlint checks if an actionlint workflow is present Fixes #18382. --- Library/Homebrew/style.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 6400f8f0af07d..493d4fc37d4fb 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -91,7 +91,11 @@ def self.check_style_impl(files, output_type, run_shfmt(shell_files, fix:) end - actionlint_result = if files.present? && actionlint_files.empty? + has_actionlint_workflow = actionlint_files.any? do |path| + path.to_s.end_with?("/.github/workflows/actionlint.yml") + end + odebug "actionlint workflow detected. Skipping actionlint checks." if has_actionlint_workflow + actionlint_result = if files.present? && (has_actionlint_workflow || actionlint_files.empty?) true else run_actionlint(actionlint_files)