Skip to content

ci: add dependency-audit.yml workflow - #51

Merged
don-petry merged 1 commit into
mainfrom
claude/issue-21-20260408-0149
Apr 8, 2026
Merged

don-petry merged 1 commit into
mainfrom
claude/issue-21-20260408-0149

Conversation

@don-petry

Copy link
Copy Markdown
Contributor

Summary

  • Adds the required dependency-audit.yml workflow to satisfy the compliance requirement (issue Compliance: missing-dependency-audit.yml #21)
  • File is copied verbatim from petry-projects/.github/standards/workflows/dependency-audit.yml
  • Workflow auto-detects ecosystems (npm, pnpm, Go, Cargo, Python) and runs the appropriate audit tool
  • Triggers on PRs and pushes to main; all actions are SHA-pinned per org policy

Closes #21

Generated with Claude Code

Adds the required dependency-audit.yml workflow copied verbatim from
petry-projects/.github/standards/workflows/dependency-audit.yml.

Auto-detects ecosystems (npm, pnpm, Go, Cargo, Python) and runs the
appropriate audit tool on PRs and pushes to main.

Closes #21

Co-authored-by: don-petry <don-petry@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 8, 2026 01:50
@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 13 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 13 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 17b8817b-c639-421b-bc37-1b0bf163b7ce

📥 Commits

Reviewing files that changed from the base of the PR and between 1d0ad9a and 61b7ca0.

📒 Files selected for processing (1)
  • .github/workflows/dependency-audit.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-21-20260408-0149

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

@sonarqubecloud

sonarqubecloud Bot commented Apr 8, 2026

Copy link
Copy Markdown

@don-petry

Copy link
Copy Markdown
Contributor Author

@don-petry CI is green — all checks passing. This PR adds the required dependency-audit.yml workflow (verbatim from the org template) to close the compliance finding in #21. Please review and merge when ready.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds the organization-required “Dependency audit” GitHub Actions workflow to bring the repository into compliance with issue #21 by automatically detecting common dependency ecosystems and running vulnerability audits on PRs and pushes to main.

Changes:

  • Introduces .github/workflows/dependency-audit.yml to detect npm, pnpm, Go modules, Cargo, and Python dependency manifests.
  • Runs ecosystem-specific audit tools (npm audit, pnpm audit, govulncheck, cargo audit, pip-audit) when corresponding files are present.
  • Uses SHA-pinned actions and minimal workflow permissions (contents: read).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cargo: ${{ steps.check.outputs.cargo }}
pip: ${{ steps.check.outputs.pip }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

The pinned actions/checkout SHA here is also used in .github/workflows/codeql.yml but is annotated as # v4 there; having it labeled # v6.0.2 in this workflow is likely incorrect/misleading. Please update the version comment to match the actual release for this SHA (and keep it consistent across all actions/checkout uses in this file).

Suggested change
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4

Copilot uses AI. Check for mistakes.
Comment on lines +169 to +171
# cargo audit operates on Cargo.lock at workspace root
# For workspaces, a single audit at root covers all crates
status=0

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

The comments state that cargo audit should run at the workspace root and that a single audit covers all crates, but the implementation below audits multiple directories. For Rust workspaces, please ensure the workflow audits only workspace roots (e.g., directories containing Cargo.lock and/or a Cargo.toml with [workspace]) to avoid duplicate/partial results and unnecessary failures.

Copilot uses AI. Check for mistakes.
Comment on lines +174 to +178
if ! (cd "$dir" && cargo generate-lockfile 2>/dev/null; cargo audit); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'Cargo.toml' -not -path '*/target/*' -exec dirname {} \; | sort -u)

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

This loop iterates over every Cargo.toml directory (find ... Cargo.toml), which will include member crates inside a workspace. That can cause cargo audit to run from non-root manifests and fail or produce incomplete scans. Consider iterating unique Cargo.lock locations instead, and structure the subshell so cargo audit only runs after a successful cd into the intended directory.

Suggested change
if ! (cd "$dir" && cargo generate-lockfile 2>/dev/null; cargo audit); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'Cargo.toml' -not -path '*/target/*' -exec dirname {} \; | sort -u)
if ! (cd "$dir" && cargo generate-lockfile 2>/dev/null && cargo audit); then
status=1
fi
echo "::endgroup::"
done < <(find . -name 'Cargo.lock' -not -path '*/target/*' -exec dirname {} \; | sort -u)

Copilot uses AI. Check for mistakes.
@don-petry
don-petry merged commit e798a8c into main Apr 8, 2026
19 checks passed
@don-petry
don-petry deleted the claude/issue-21-20260408-0149 branch April 8, 2026 02:24
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.

Compliance: missing-dependency-audit.yml

2 participants