REMOVE triage bot PRs workflow #98
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Snyk Security | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| jobs: | |
| snyk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check for Snyk token | |
| id: tok | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| run: | | |
| if [ -n "$SNYK_TOKEN" ]; then | |
| echo "has=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "has=false" >> "$GITHUB_OUTPUT" | |
| echo "No SNYK_TOKEN secret is set. Skipping Snyk scan." | |
| fi | |
| - name: Set up Snyk CLI | |
| if: steps.tok.outputs.has == 'true' | |
| uses: snyk/actions/setup@8e119fbb6c251787721d34ba683ed48eba792766 # master | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| - name: Run Snyk Code test | |
| if: steps.tok.outputs.has == 'true' | |
| run: snyk code test --sarif-file-output=snyk-code.sarif || true | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| - name: Upload result to GitHub Code Scanning | |
| if: steps.tok.outputs.has == 'true' && hashFiles('snyk-code.sarif') != '' | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: snyk-code.sarif |