Skip to content
Merged
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 Fail the Semgrep check on findings

When this workflow is used as a PR/status check, semgrep scan exits successfully even when it reports matches; Semgrep's CLI docs state exit code 0 is used when findings exist unless the --error flag is enabled. Because this workflow also does not upload SARIF or otherwise publish results, security findings are only hidden in logs while the check stays green, so add --error here if the scan is meant to protect PRs and main pushes.

Useful? React with 👍 / 👎.