Skip to content

fix: error when using default action config#9

Merged
NyanKiyoshi merged 1 commit intomainfrom
fix/error-when-using-default-config
Mar 5, 2026
Merged

fix: error when using default action config#9
NyanKiyoshi merged 1 commit intomainfrom
fix/error-when-using-default-config

Conversation

@NyanKiyoshi
Copy link
Copy Markdown
Member

@NyanKiyoshi NyanKiyoshi commented Mar 4, 2026

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.

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.
```
@NyanKiyoshi NyanKiyoshi requested a review from a team March 4, 2026 16:11
@NyanKiyoshi NyanKiyoshi self-assigned this Mar 4, 2026
@NyanKiyoshi NyanKiyoshi requested review from cmiacz and przlada March 4, 2026 16:11
@NyanKiyoshi NyanKiyoshi added the bug Something isn't working label Mar 4, 2026
@NyanKiyoshi NyanKiyoshi requested a review from IKarbowiak March 4, 2026 16:11
@NyanKiyoshi NyanKiyoshi merged commit a4ea2e1 into main Mar 5, 2026
8 checks passed
@NyanKiyoshi NyanKiyoshi deleted the fix/error-when-using-default-config branch March 5, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants