snyk-scan.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. contents: read
  11. security-events: write
  12. jobs:
  13. # https://github.com/snyk/actions/tree/master/php
  14. snyk-php:
  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@v6
  24. - name: Run Snyk to check for vulnerabilities
  25. uses: snyk/actions/php@master
  26. continue-on-error: true # To make sure that SARIF upload gets called
  27. env:
  28. SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
  29. with:
  30. args: --sarif-file-output=snyk.sarif
  31. - name: Upload result to GitHub Code Scanning
  32. uses: github/codeql-action/upload-sarif@v4
  33. with:
  34. sarif_file: snyk.sarif