diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml new file mode 100644 index 00000000..34bac764 --- /dev/null +++ b/.github/workflows/semgrep.yml @@ -0,0 +1,38 @@ +--- +# Name of this GitHub Actions workflow. +name: Semgrep + +on: + pull_request: + workflow_dispatch: + push: + branches: + - main + # Täglicher Scan um 17:20 Uhr UTC. + schedule: + - cron: "20 17 * * *" + +jobs: + semgrep: + name: semgrep/ci + runs-on: ubuntu-latest + + container: + image: returntocorp/semgrep + + if: (github.actor != 'dependabot[bot]') + + steps: + - name: "🧰 Check out code" + uses: actions/checkout@v3 + + - name: Run semgrep ci + run: semgrep ci --sarif --output=semgrep.sarif + env: + SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} + + - name: Upload SARIF file for GitHub Advanced Security Dashboard + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: semgrep.sarif + if: always()