From 5c8ca023e62e1b4516a1c687229800c6b6b78f4a Mon Sep 17 00:00:00 2001 From: Amin Vakil Date: Wed, 19 Aug 2026 05:15:49 +0330 Subject: [PATCH] Only run actionlint on github workflow files (#5154) * Add test to fail on dependabot.yml * Run only on .github/workflows --- ale_linters/yaml/actionlint.vim | 4 ++-- test/linter/test_yaml_actionlint.vader | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ale_linters/yaml/actionlint.vim b/ale_linters/yaml/actionlint.vim index 902da7296..38675ee01 100644 --- a/ale_linters/yaml/actionlint.vim +++ b/ale_linters/yaml/actionlint.vim @@ -5,8 +5,8 @@ call ale#Set('yaml_actionlint_executable', 'actionlint') call ale#Set('yaml_actionlint_options', '') function! ale_linters#yaml#actionlint#GetCommand(buffer) abort - " Only execute actionlint on YAML files in /.github/ paths. - if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]' + " Only execute actionlint on YAML files in /.github/workflows/ paths. + if expand('#' . a:buffer . ':p') !~# '\v[/\\]\.github[/\\]workflows[/\\]' return '' endif diff --git a/test/linter/test_yaml_actionlint.vader b/test/linter/test_yaml_actionlint.vader index db34007f1..2ea7b330d 100644 --- a/test/linter/test_yaml_actionlint.vader +++ b/test/linter/test_yaml_actionlint.vader @@ -1,6 +1,6 @@ Before: call ale#assert#SetUpLinterTest('yaml', 'actionlint') - call ale#test#SetFilename('/.github/file.yml') + call ale#test#SetFilename('/.github/workflows/file.yml') After: call ale#assert#TearDownLinterTest() @@ -18,3 +18,8 @@ Execute(Options should be added to command): Execute(actionlint not run on files outside of /.github/ paths): call ale#test#SetFilename('/something-else/file.yml') + +Execute(actionlint not run on Dependabot configuration files): + call ale#test#SetFilename('/.github/dependabot.yml') + + AssertLinterNotExecuted