2.11.5b: Add github action to run snyk #7
This file contains 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: Scan PHP code with Snyk Code | |
on: | |
push: | |
branches: | |
- main | |
- development | |
pull_request: | |
jobs: | |
security: | |
runs-on: ubuntu-latest | |
name: run-snyk | |
env: | |
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Snyk & Authenticate | |
run: | | |
sudo npm install -g snyk | |
snyk auth ${SNYK_TOKEN} | |
- name: Run Snyk Code | |
run: | | |
snyk code test -d --sarif > snyk-results.sarif | |
continue-on-error: true | |
- name: Upload results from Snyk to GitHub Code Scanning | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: snyk-results.sarif | |