snyk-scan.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # This is a basic workflow to help you get started with Actions
  2. name: Snyk scan
  3. on:
  4. # Triggers the workflow on push or pull request events but only for the master branch
  5. push:
  6. branches: [ master ]
  7. pull_request:
  8. branches: [ master ]
  9. permissions: {}
  10. jobs:
  11. # https://github.com/snyk/actions/tree/master/php
  12. snyk-php:
  13. permissions:
  14. security-events: write
  15. runs-on: ubuntu-latest
  16. if: |
  17. github.repository == 'PrivateBin/PrivateBin' && (
  18. github.event.pull_request.author_association == 'COLLABORATOR' ||
  19. github.event.pull_request.author_association == 'CONTRIBUTOR' ||
  20. github.event.pull_request.author_association == 'MEMBER' ||
  21. github.event.pull_request.author_association == 'OWNER' )
  22. steps:
  23. - uses: actions/checkout@v7
  24. with:
  25. persist-credentials: false
  26. - name: Run Snyk to check for vulnerabilities
  27. uses: snyk/actions/php@master
  28. continue-on-error: true # To make sure that SARIF upload gets called
  29. env:
  30. SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
  31. with:
  32. args: --sarif-file-output=snyk.sarif
  33. - name: Upload result to GitHub Code Scanning
  34. uses: github/codeql-action/upload-sarif@v4
  35. with:
  36. sarif_file: snyk.sarif