Skip to content

Add cargo-vet and cargo-deny supply-chain security#44

Open
jerrysxie wants to merge 1 commit into
OpenDevicePartnership:mainfrom
jerrysxie:add-supply-chain-security
Open

Add cargo-vet and cargo-deny supply-chain security#44
jerrysxie wants to merge 1 commit into
OpenDevicePartnership:mainfrom
jerrysxie:add-supply-chain-security

Conversation

@jerrysxie
Copy link
Copy Markdown
Contributor

This PR adds supply-chain security tooling based on the
embedded-rust-template:

  • cargo-vet (supply-chain/) – dependency audit tracking with imports
    from ODP shared audits, Google, and Mozilla.
  • cargo-deny (deny.toml) – license, advisory, ban, and source checks.
  • CI workflowscargo-vet.yml + PR comment workflow, and the
    deny job in check.yml.

After merging, run cargo vet locally to populate exemptions for any
existing unaudited dependencies:

cargo vet regenerate exemptions
cargo vet

Copilot AI review requested due to automatic review settings May 12, 2026 20:21
@jerrysxie jerrysxie requested a review from a team as a code owner May 12, 2026 20:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Rust supply-chain tooling centered around cargo-vet, including a repo-local supply-chain/ configuration and CI automation to run cargo vet on PRs and (optionally) comment results back on the PR.

Changes:

  • Introduces supply-chain/ cargo-vet configuration scaffolding (config, audits, and imports lock).
  • Adds a cargo-vet PR workflow to run cargo vet --locked.
  • Adds a follow-up workflow_run workflow to post/update a PR comment and apply a label based on the cargo-vet result.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
supply-chain/imports.lock Initializes cargo-vet imports lock sections for upstream audit sources.
supply-chain/config.toml Configures cargo-vet and upstream audit import URLs.
supply-chain/audits.toml Adds the local audits file scaffold.
.github/workflows/cargo-vet.yml Runs cargo-vet in CI and uploads the PR number artifact.
.github/workflows/cargo-vet-pr-comment.yml Posts/updates PR comments (and labels) based on cargo-vet workflow results.

Comment on lines +43 to +49
if: ${{ failure() }} || ${{ success() }}
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/NR
- uses: actions/upload-artifact@v4
# Need to upload the artifact in both success and failure cases so comment can be updated in either case
if: ${{ failure() }} || ${{ success() }}

permissions:
contents: read
pull-requests: write
Comment on lines +33 to +37
- name: 'Download artifact'
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
name: pr
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
# Cargo Vet Audit Failed

`cargo vet` has failed in this PR. Please run `cargo vet --locked` locally to check for new or updated unvetted dependencies.
Details about the vetting process can be found in [supply-chain/README.md](../blob/main/supply-chain/README.md)
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
Comment on lines +25 to +33

- uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/cargo-vet
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}

- name: Add the tool cache directory to the search path
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH

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.

2 participants