Skip to content

Commit a4ea2e1

Browse files
authored
fix: error when using default action config (#9)
This fixes a crash when using the default config from our repository, the workflow would error-out with the following: ``` $ docker-here returntocorp/semgrep@sha256:396f4ad7a655289e764ab2f92733e6195c166ff2f042e0d40505a5850432b9ac semgrep --metrics=off --config=./ ./ semgrep error: Invalid rule schema --> .github/dependabot.yaml:1 1 | version: 2 2 | 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "monthly" 8 | cooldown: 9 | default-days: 21 # 3 weeks One of these properties is missing: 'rules' [ERROR] invalid configuration file found (1 configs were invalid) ``` This is due to Semgrep selecting all YAML files, including the ones under `.github/`. In the past, Semgrep was excluding hidden folders which isn't the case anymore. Results after the changes: ``` $ docker-here returntocorp/semgrep@sha256:396f4ad7a655289e764ab2f92733e6195c166ff2f042e0d40505a5850432b9ac semgrep --metrics=off --config=./yaml --config=./typescript ./ ┌─────────────┐ │ Scan Status │ └─────────────┘ Scanning 13 files (only git-tracked) with 2 Code rules: CODE RULES Scanning 6 files. SUPPLY CHAIN RULES No rules to run. PROGRESS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00 ┌──────────────┐ │ Scan Summary │ └──────────────┘ Some files were skipped or only partially analyzed. Scan was limited to files tracked by git. Scan skipped: 2 files matching .semgrepignore patterns For a full list of skipped files, run semgrep with the --verbose flag. Ran 1 rule on 6 files: 0 findings. ```
1 parent c13b396 commit a4ea2e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/action-run-semgrep.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ env:
6868
auto
6969
p/ci
7070
r/yaml.github-actions
71-
./saleor-rules
71+
./saleor-rules/yaml
72+
./saleor-rules/typescript
7273
# yaml.github-actions.[...].run-shell-injection is duplicate of saleor-rules.yaml.github-actions.script-injection
7374
DEFAULT_EXCLUDE_RULE_IDS: |
7475
yaml.github-actions.security.run-shell-injection.run-shell-injection

0 commit comments

Comments
 (0)