fix(snyk): Update action and split report upload#318
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces deprecated Snyk action steps in the CI workflow with explicit Snyk CLI setup and run commands, and splits SARIF uploads into two distinct upload steps (opensource and code) with their respective categories and file-existence conditionals. A backlog task document is added. Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions Runner
participant Setup as Snyk Setup Action
participant SnykCLI as Snyk CLI
participant SARIF as SARIF Upload Action
GH->>Setup: uses `snyk/actions/setup@v1.0.0`
GH->>SnykCLI: run `snyk test --sarif-output=snyk/opensource.sarif ...`
GH->>SnykCLI: run `snyk code test --sarif-output=snyk/code.sarif ...`
GH->>SnykCLI: run `snyk monitor ...`
GH->>SARIF: upload `snyk/opensource.sarif` (category: snyk-opensource)
GH->>SARIF: upload `snyk/code.sarif` (category: snyk-code)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/snyk.yml:
- Line 49: Replace the mutable action ref "snyk/actions/setup@master" with an
immutable tag or commit SHA to reduce supply-chain risk; update the workflow
entry that references the Snyk setup action (the uses line for
snyk/actions/setup) to a versioned tag like "snyk/actions/setup@v1.0.0" or a
specific commit SHA (e.g.,
"snyk/actions/setup@dc22abdbe8ec00e2a925256fef96f319ca5510ce") and commit the
change in the workflow file.
- Around line 64-75: Add a guarding check step before each SARIF upload to skip
the upload when the file is missing: create steps with ids
check-opensource-sarif and check-code-sarif that run a shell test (e.g., run:
test -f snyk/opensource.sarif && echo "::set-output name=exists::true" || echo
"::set-output name=exists::false") and then change the upload steps (the ones
using github/codeql-action/upload-sarif@v4 that refer to sarif_file:
snyk/opensource.sarif and snyk/code.sarif) to use if: ${{ always() &&
steps.check-opensource-sarif.outputs.exists == 'true' }} and if: ${{ always() &&
steps.check-code-sarif.outputs.exists == 'true' }} respectively so the upload
only runs when the SARIF file actually exists.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1647e68b-5ef6-4889-a0c6-2d2359d7873b
📒 Files selected for processing (2)
.backlog/tasks/task-11 - Fix-snyk-workflow.md.github/workflows/snyk.yml
Summary
Summary by CodeRabbit
Documentation
Chores
Checklist
type(scope): description)dotnet build src/Objectivity.AutoFixture.XUnit2.AutoMock.slnpasses with no warningsdotnet test src/Objectivity.AutoFixture.XUnit2.AutoMock.slnpasses on all framework slices[SuppressMessage]without a justification comment// TODO:comments added — open a GitHub issue instead