SP-1022 | Update Semgrep configuration

This commit is contained in:
security user
2024-10-30 12:32:43 +05:30
parent 76f62763d8
commit 7a50f4276d

43
.github/workflows/semgrep.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Semgrep
on:
# Scan changed files in PRs, block on new issues only (existing issues ignored)
pull_request:
branches:
- master
- main
# Schedule this job to run at a certain time, using cron syntax
# Note that * is a special character in YAML so you have to quote this string
schedule:
- cron: '00 03 * * 0' # scheduled for 8.30 AM on every sunday
jobs:
central-semgrep:
name: Static code Analysis
uses: navi-infosec/central-semgrep-action/.github/workflows/central-semgrep.yml@using-token
with:
github-event-number: ${{github.event.number}}
github-event-name: ${{github.event_name}}
github-repository: ${{github.repository}}
github-pr_owner_name: ${{github.event.pull_request.user.login}}
secrets:
READ_SEMGREP_RULES_TOKEN: ${{secrets.READ_SEMGREP_RULES_TOKEN}}
EMAIL_FETCH_TOKEN: ${{secrets.EMAIL_FETCH_TOKEN}}
run-if-failed:
runs-on: [ self-hosted ]
needs: [central-semgrep]
if: always() && (needs.semgrep.result == 'failure')
steps:
- name: Create comment
if: ${{ ( github.event.number != '' ) }}
uses: navi-synced-actions/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
**Vulnerabilities have been discovered in this PR. Please check the vulnerability Analysis section of Semgrep Workflow to understand the security vulnerability. Feel free to reach out to #sast-help for more information **
- name: Assign Reviewers
if: ${{ ( github.event.number != '' ) }}
uses: navi-infosec/security-oncall-action@v1.1