From fe794caaab414cee0faa13ce38265c66950eef5a Mon Sep 17 00:00:00 2001 From: Matt Schwager Date: Tue, 6 Feb 2024 08:57:24 -0700 Subject: [PATCH 1/2] Fix broken validation CI step --- .github/workflows/semgrep-rules-test.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/semgrep-rules-test.yml b/.github/workflows/semgrep-rules-test.yml index 69981ef..60af6e6 100644 --- a/.github/workflows/semgrep-rules-test.yml +++ b/.github/workflows/semgrep-rules-test.yml @@ -20,7 +20,17 @@ jobs: python3 -m pip install semgrep python3 -m pip install jsonschema pyyaml - name: validations - run: semgrep --validate --config . + run: | + config_args=$( + for dir in $( + find . -type directory -maxdepth 1 -mindepth 1 -not -path '*/.*' + ); + do + echo -n " --config $dir"; + done + ) + echo "Semgrep config arguments: $config_args" + semgrep scan --validate $config_args - name: tests run: semgrep --test --test-ignore-todo - name: metadata-tests @@ -29,4 +39,4 @@ jobs: wget https://raw.githubusercontent.com/returntocorp/semgrep-rules/develop/metadata-schema.yaml.schm python ./validate-metadata.py -s ./metadata-schema.yaml.schm -f . - name: rules-tests - run: semgrep --config="r/yaml.semgrep" --severity ERROR . + run: semgrep scan --config="r/yaml.semgrep" --severity ERROR . From 4a41400d654e4d368285ae320d15045d4d24f194 Mon Sep 17 00:00:00 2001 From: Matt Schwager Date: Tue, 6 Feb 2024 09:13:53 -0700 Subject: [PATCH 2/2] Short find type --- .github/workflows/semgrep-rules-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semgrep-rules-test.yml b/.github/workflows/semgrep-rules-test.yml index 60af6e6..0471257 100644 --- a/.github/workflows/semgrep-rules-test.yml +++ b/.github/workflows/semgrep-rules-test.yml @@ -23,7 +23,7 @@ jobs: run: | config_args=$( for dir in $( - find . -type directory -maxdepth 1 -mindepth 1 -not -path '*/.*' + find . -type d -maxdepth 1 -mindepth 1 -not -path '*/.*' ); do echo -n " --config $dir";