Skip to content

Add Trivy vulnerability scan workflow with Devin API integration#6

Open
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1765302317-trivy-scan-workflow
Open

Add Trivy vulnerability scan workflow with Devin API integration#6
devin-ai-integration[bot] wants to merge 2 commits into
masterfrom
devin/1765302317-trivy-scan-workflow

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Dec 9, 2025

Summary

Adds a new GitHub Actions workflow (.github/workflows/trivy-scan.yml) that automatically scans for security vulnerabilities on pushes to master/main and triggers a Devin session to fix them when vulnerabilities are detected.

The workflow:

  1. Runs Trivy filesystem scan for CRITICAL, HIGH, and MEDIUM severity vulnerabilities
  2. Parses the JSON output to extract vulnerability details
  3. If vulnerabilities are found, calls the Devin API v1 to create a session with a detailed prompt instructing Devin to update dependencies and create a fix PR
  4. Uploads scan results as artifacts for reference

Updates since last revision

Review & Testing Checklist for Human

  • Add the DEVIN_API_TOKEN secret to repository settings (Settings > Secrets and variables > Actions) before merging - the workflow will fail without it
  • Review the jq parsing logic (lines 39, 48-67) for edge cases - if Trivy returns an empty or malformed JSON, the parsing could behave unexpectedly
  • Verify the Devin prompt (lines 80-110) aligns with your expectations for how Devin should handle vulnerability fixes
  • Consider whether you want the workflow to fail (exit 1) when the Devin API call fails, or if it should just warn

Recommended test plan:

  1. Add the DEVIN_API_TOKEN secret to the repository
  2. Merge this PR to master
  3. The workflow should automatically run and detect the known outdated dependencies (Spring Boot 2.6.3, jjwt 0.11.2, SQLite JDBC 3.36.0.3)
  4. Check the Actions tab to verify the workflow runs successfully
  5. Verify a Devin session is created (link will be in the workflow logs)

Notes

  • The workflow uses idempotent: true in the Devin API call to prevent duplicate sessions if the workflow is re-run
  • Only triggers on master/main branch pushes (not on PRs or other branches)
  • Get your Devin API token from: https://app.devin.ai/settings/api-keys

Link to Devin run: https://app.devin.ai/sessions/7768e799d6fe43e7b9f5b2c4eca4f0e5
Requested by: Marcel Schwager (marcel.schwager@codeium.com) / @marcelschwager-ux

Co-Authored-By: Marcel Schwager <marcel.schwager@codeium.com>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Marcel Schwager <marcel.schwager@codeium.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants