Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Semgrep

permissions: {}

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
semgrep:
name: Semgrep
runs-on: ubuntu-latest
container:
image: semgrep/semgrep:1.170.0
steps:
- uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2

- run: semgrep scan --config auto

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make Semgrep fail when it finds issues

As configured for PRs and pushes, semgrep scan --config auto only prints findings and still exits successfully; Semgrep's CLI reference documents that semgrep scan exits 0 when findings are present unless --error is used, and their CI command is semgrep ci. This means the new required-looking workflow can go green even when the scan reports vulnerabilities, so use semgrep scan --error --config auto or switch to semgrep ci if the check is meant to block regressions.

Useful? React with 👍 / 👎.

Loading