[Snyk] Upgrade tap from 18.0.0 to 21.1.0 #14
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: code delta | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| snyk-pipeline: | |
| runs-on: ubuntu-latest | |
| name: code delta | |
| env: | |
| SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | |
| steps: | |
| # Checkout base ref branch | |
| - uses: actions/checkout@v5 | |
| with: | |
| ref: ${{ github.base_ref }} | |
| - name: Download Snyk | |
| run: | | |
| wget -O snyk https://static.snyk.io/cli/latest/snyk-linux | |
| chmod +x ./snyk | |
| mv ./snyk /usr/local/bin/ | |
| - name: Authenticate Snyk | |
| run: snyk auth ${SNYK_TOKEN} | |
| - name: Run Snyk Code | |
| run: snyk code test --json-file-output=${{ github.workspace }}/snyk_code_baseline.json | |
| continue-on-error: true | |
| # Upload the Snyk Code results from the main branch | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: snyk_code_baseline | |
| path: ${{ github.workspace }}/snyk_code_baseline.json | |
| # Checkout PR branch | |
| - uses: actions/checkout@v5 | |
| - name: Authenticate Snyk | |
| run: snyk auth ${SNYK_TOKEN} | |
| - name: Run Snyk Code | |
| run: | | |
| sleep 10s | |
| snyk code test --json-file-output=${{ github.workspace }}/snyk_code_pr.json || true | |
| continue-on-error: true | |
| # Upload the Snyk Code results from the PR scan | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: snyk_code_pr | |
| path: ${{ github.workspace }}/snyk_code_pr.json | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: snyk_code_baseline | |
| - name: Check if new issues have been introduced via the PR | |
| run: | | |
| cd "${{ github.workspace }}/.git" | |
| ls -a | |
| chmod +x "${{ github.workspace }}/.github/snyk-pr-diff-amd64-linux" | |
| ${{ github.workspace }}/.github/snyk-pr-diff-amd64-linux code ${{ github.workspace }}/snyk_code_baseline.json ${{ github.workspace }}/snyk_code_pr.json |