Skip to content

Add dependency review workflow to scan for license violations and CVEs#105

Merged
Zahnentferner merged 10 commits intoAOSSIE-Org:mainfrom
kpj2006:patch-4
Mar 19, 2026
Merged

Add dependency review workflow to scan for license violations and CVEs#105
Zahnentferner merged 10 commits intoAOSSIE-Org:mainfrom
kpj2006:patch-4

Conversation

@kpj2006
Copy link
Contributor

@kpj2006 kpj2006 commented Mar 17, 2026

Addressed Issues:

Fixes #(issue number)

Screenshots/Recordings:

Additional Notes:

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • [s] My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Added an automated dependency review workflow that runs on pull requests to main/master/develop and re-runs only when dependency manifests change.
    • Enforces vulnerability checks (failing on moderate-or-higher for runtime dependencies), strict license whitelisting, and blocks security advisories by default.
    • Includes optional post-PR summary outputs for visibility.

@github-actions github-actions bot added no-issue-linked PR is not linked to any issue ci-cd CI/CD pipeline changes configuration Configuration file changes github-actions GitHub Actions workflow changes size/M Medium PR (51-200 lines changed) repeat-contributor PR from an external contributor who already had PRs merged pending-coderabbit-review labels Mar 17, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

Walkthrough

Adds a new GitHub Actions workflow .github/workflows/dependency-review-action.yml that runs dependency-review-action@v4 on PRs touching dependency manifests, enforcing fail-on-severity: moderate, runtime scope, an allowlisted license set, empty GHSA exceptions, and GHSA vulnerability checks.

Changes

Cohort / File(s) Summary
Dependency Review Workflow
.github/workflows/dependency-review-action.yml
New workflow triggered on PRs to main/master/develop when dependency manifest paths change. Runs actions/dependency-review-action@v4 with fail-on-severity: moderate, fail-on-scopes: runtime, explicit allow-licenses, no allow-ghsas, vulnerability-check: true, and commented example outputs/badge steps.

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant GitHub as GitHub (PR)
  participant Actions as GitHub Actions
  participant DepReview as dependency-review-action@v4
  participant GHSA as GHSA/API

  Contributor->>GitHub: Open PR modifying dependency manifests
  GitHub->>Actions: Trigger dependency-review workflow (path filters matched)
  Actions->>DepReview: Execute configured dependency review
  DepReview->>GHSA: Query vulnerability data (vulnerability-check)
  GHSA-->>DepReview: Return GHSA findings
  DepReview-->>Actions: Emit results (fail/warn per config)
  Actions-->>GitHub: Update PR check status
  GitHub-->>Contributor: Surface check results on PR
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • Zahnentferner

Poem

🐰 I hopped into CI with a tap and a click,
I sniffed every manifest, quick as a trick.
Licenses lined up, GHSA in view,
I guard the PR gates — nimble and true. 🥕

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a GitHub Actions workflow for dependency review that scans for license violations and CVEs, which directly matches the changeset content.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 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/dependency-review-action.yml:
- Around line 116-118: The comment above the warn-only setting is incorrect:
when warn-only: false the action will fail on license issues rather than just
warn; update the comment that currently reads "Warn (don't fail) for packages
with no license info." to clearly state that setting warn-only: false will cause
the action to fail on packages with no license info (or flip the boolean to true
if you want warning-only behavior) so the comment and the YAML key warn-only:
false are consistent.
- Around line 67-69: Update the misleading comment above the fail-on-scopes
setting so it accurately describes that fail-on-scopes controls which dependency
scopes (runtime, development, unknown) will cause the workflow to fail when
vulnerabilities are detected, rather than controlling whether fixes are
available; specifically revise the comment near the fail-on-scopes: runtime
entry to remove the "no fix is yet available" wording and state that it selects
which scopes trigger failures on found CVEs.
- Around line 56-60: Replace the floating tags actions/checkout@v4 and
actions/dependency-review-action@v4 with their corresponding full commit SHAs to
prevent tag-hijacking; locate the two usages of "uses: actions/checkout@v4" and
"uses: actions/dependency-review-action@v4" in the workflow and update them to
the vetted commit SHAs (optionally add a trailing comment with the semver tag
for readability), and consider using Dependabot/Renovate to keep those SHAs up
to date.
- Around line 97-99: The allow-dependencies-licenses list contains placeholder
package entries pkg:npm/@aossie/core and pkg:npm/@myorg/mypackage; remove these
placeholder strings from the allow-dependencies-licenses value or replace them
with your actual allowed package coordinates, or explicitly mark them as
examples via comments and include a brief instruction on replacing them. Update
the allow-dependencies-licenses block so it only contains real allowed packages
(or documented example entries) and ensure any comment clearly references the
two placeholder tokens so future editors know to replace or remove them.
- Around line 75-91: The deny-licenses list uses deprecated SPDX IDs; update the
values under the deny-licenses key so each deprecated identifier (GPL-2.0,
GPL-3.0, LGPL-2.0, LGPL-2.1, LGPL-3.0, AGPL-1.0, AGPL-3.0) is replaced with the
modern SPDX forms (e.g., GPL-2.0-only, GPL-3.0-only, LGPL-2.0-only,
LGPL-2.1-only, LGPL-3.0-only, AGPL-1.0-only, AGPL-3.0-only); if you need to deny
both fixed and later-published variants, include the corresponding -or-later
entries as well (e.g., GPL-2.0-or-later) alongside or instead of the -only form.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: aaae28f2-7468-4e00-835c-c76ce33a7612

📥 Commits

Reviewing files that changed from the base of the PR and between b586b0c and 6d5a799.

📒 Files selected for processing (1)
  • .github/workflows/dependency-review-action.yml

kpj2006 and others added 4 commits March 18, 2026 03:02
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 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/dependency-review-action.yml:
- Around line 2-3: The workflow comments contradict the actual license rules:
update the header/comment "Blocks merges on license violations
(GPL/LGPL/restrictive)" and any inline comments near the license list so they
reflect the configured policy (either block copyleft licenses or allow them) —
specifically reconcile the top comment and the comment around the
allowed-licenses list that currently permits "GPL/LGPL/AGPL" so the text and the
configured allow/deny entries match; ensure comments mention the authoritative
behavior (deny or allow) and that the license names in comments match the
entries in the allowed/denied lists.
- Around line 100-107: Remove the duplicated comment block that starts with
"ALLOW EXCEPTIONS: Packages that are explicitly approved" (the repeated guidance
and format lines) so only a single guidance block remains; edit the section in
the github workflow by deleting the second occurrence of the identical ALLOW
EXCEPTIONS comment lines and keep one correctly formatted block with the same
explanatory text and example format.
- Around line 56-60: The workflow includes an unnecessary "Checkout Repository"
step using actions/checkout@v4 before the Run Dependency Review step; remove the
step named "Checkout Repository" (the actions/checkout@v4 invocation) so the job
runs only the actions/dependency-review-action@v4 step, ensuring the
dependency-review action can operate without checking out the repo and reducing
runtime and surface area.
- Around line 18-44: The workflow's path filters miss .yaml variants; update the
paths list in the dependency-review-action workflow to add the alternate
extensions by including "docker-compose*.yaml" alongside "docker-compose*.yml"
and ".github/workflows/*.yaml" alongside ".github/workflows/*.yml" so YAML files
with the .yaml extension are caught; leave existing root-level entries like
"package.json" and "Dockerfile" unchanged since they already match nested files.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 268c1522-8513-4d51-884c-f747f9e214c2

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5a799 and 1d733ad.

📒 Files selected for processing (1)
  • .github/workflows/dependency-review-action.yml

# ── Edit this list when adding approved exceptions ──
# ALLOW EXCEPTIONS: Packages that are explicitly approved
# even if they match a denied license pattern.
# Format: "pkg:npm/name, pkg:pypi/name, pkg:githubactions/owner/repo@version"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong.

See this:

Image

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/dependency-review-action.yml:
- Around line 131-149: The commented "Post Review Summary" step's remediation
guidance incorrectly tells readers to "Replace GPL-licensed packages" which
conflicts with the workflow's allowed-licenses policy (GPL/LGPL/AGPL allowed in
the earlier policy block). Update the summary text in the "Summarize Result"
step (name: "📋 Summarize Result") to remove the suggestion to replace GPL
packages and instead advise actions consistent with the license policy—e.g.,
verify the package is on the allowed-licenses list or add an explicit
exception—so the guidance no longer conflicts with the allowed GPL/LGPL/AGPL
entries.
- Around line 16-43: The path filters in the workflow use root-only patterns
(e.g., "package.json", "requirements*.txt", "go.mod", "pom.xml", "Dockerfile")
which miss nested manifests in monorepos; update the list in
.github/workflows/dependency-review-action.yml to use recursive globs by
prefixing each entry with "**/" (for example "**/package.json",
"**/requirements*.txt", "**/go.mod", "**/pom.xml", "**/Dockerfile", etc.) so
files at any depth are matched by the workflow.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 6c840a52-a793-49e4-8059-027afc59edb5

📥 Commits

Reviewing files that changed from the base of the PR and between 1d733ad and 7c105b1.

📒 Files selected for processing (1)
  • .github/workflows/dependency-review-action.yml

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/dependency-review-action.yml:
- Around line 9-16: The workflow currently only triggers on pull_request changes
(the on: pull_request block with branches and paths), so newly disclosed CVEs
for unchanged manifests are missed; add a periodic trigger (schedule with cron)
and/or a manual trigger (workflow_dispatch) to the on: section so the job runs
regularly and can be manually invoked to rescan dependencies and surface new
advisories.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: fa8995da-8a39-47cd-84de-eadf009e94cb

📥 Commits

Reviewing files that changed from the base of the PR and between 7c105b1 and 87c0c41.

📒 Files selected for processing (1)
  • .github/workflows/dependency-review-action.yml

Comment on lines +9 to +16
on:
pull_request:
branches:
- main
- master
- develop
# Only re-run when dependency manifests actually change
paths:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Consider a scheduled/manual run to catch newly disclosed CVEs.

This workflow triggers on PR manifest changes, so advisories published later for unchanged dependencies won’t be surfaced here. A periodic run (or workflow_dispatch) can close that gap.

📌 Optional workflow trigger extension
 on:
+  workflow_dispatch:
+  schedule:
+    - cron: "0 3 * * 1" # weekly, Monday 03:00 UTC
   pull_request:
     branches:
       - main
       - master
       - develop
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/dependency-review-action.yml around lines 9 - 16, The
workflow currently only triggers on pull_request changes (the on: pull_request
block with branches and paths), so newly disclosed CVEs for unchanged manifests
are missed; add a periodic trigger (schedule with cron) and/or a manual trigger
(workflow_dispatch) to the on: section so the job runs regularly and can be
manually invoked to rescan dependencies and surface new advisories.

@Zahnentferner Zahnentferner merged commit 6ef9363 into AOSSIE-Org:main Mar 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI/CD pipeline changes configuration Configuration file changes github-actions GitHub Actions workflow changes no-issue-linked PR is not linked to any issue pending-coderabbit-review repeat-contributor PR from an external contributor who already had PRs merged size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants