Skip to content

chore: add Dependabot security-only update config#1

Merged
don-petry merged 4 commits intomainfrom
chore/dependabot-security-standards
Apr 4, 2026
Merged

chore: add Dependabot security-only update config#1
don-petry merged 4 commits intomainfrom
chore/dependabot-security-standards

Conversation

@don-petry
Copy link
Copy Markdown
Owner

Summary

  • Add .github/dependabot.yml with cargo (security-only, limit 0) and github-actions (version updates, limit 10) ecosystems
  • Add dependabot-automerge.yml workflow for auto-approving and squash-merging patch/minor Dependabot PRs
  • Add dependency-audit.yml CI workflow that runs cargo audit on every PR and push to main

Aligns with org-wide Dependabot security-only standards (petry-projects/.github#9).

Test plan

  • Verify dependabot.yml is valid YAML and accepted by GitHub
  • Verify dependency-audit.yml detects Cargo ecosystem and runs cargo audit
  • Verify dependabot-automerge.yml workflow syntax is valid

🤖 Generated with Claude Code

Add Dependabot configuration for cargo and github-actions ecosystems
with weekly schedule. Include automerge workflow for patch/minor updates
and dependency-audit workflow for vulnerability scanning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 3, 2026 18:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 Dependabot configuration and GitHub Actions workflows to improve dependency security automation (scheduled updates, automated merging of safe Dependabot PRs, and CI vulnerability auditing).

Changes:

  • Added .github/dependabot.yml to configure Dependabot updates for Cargo and GitHub Actions.
  • Added a dependency-audit workflow to detect ecosystems and run relevant vulnerability scanners (including cargo audit).
  • Added a dependabot-automerge workflow to auto-approve and squash-merge eligible Dependabot PRs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.

File Description
.github/dependabot.yml Configures Dependabot update schedules/limits and labels for Cargo + GitHub Actions.
.github/workflows/dependency-audit.yml Adds CI workflow that detects ecosystems and runs vulnerability audit tools.
.github/workflows/dependabot-automerge.yml Adds workflow to auto-approve and merge Dependabot PRs based on update type.

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

Comment on lines +20 to +23
contents: read

jobs:
detect:
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

This workflow uses ubuntu-latest for all jobs, but the repository’s other workflows pin runners (e.g., ubuntu-24.04 in .github/workflows/ci.yml and release.yml). Using ubuntu-latest can introduce sudden environment changes; consider pinning to the same runner version for consistency and stability.

Copilot uses AI. Check for mistakes.
Comment on lines +109 to +113
while IFS= read -r dir; do
echo "::group::govulncheck $dir"
if ! (cd "$dir" && govulncheck ./...); then
status=1
fi
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

cargo install cargo-audit without version pinning (and without --locked) is non-deterministic and can break the workflow when a new cargo-audit release lands. Consider pinning a known-good version and/or using --locked (and optionally caching) to make the audit job more reliable and faster.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +9
schedule:
interval: "weekly"
open-pull-requests-limit: 0
labels:
- "security"
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The PR description says Cargo updates should be security-only (open-pull-requests-limit 0), but this entry is configured to allow up to 10 version-update PRs. If the intent is security-only for Cargo, set open-pull-requests-limit to 0 so Dependabot doesn’t open routine version bump PRs.

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +111
run: |
status=0
while IFS= read -r dir; do
echo "::group::govulncheck $dir"
if ! (cd "$dir" && govulncheck ./...); then
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The Cargo audit job uses cargo install/cargo audit but never installs a Rust toolchain. This repo’s CI installs Rust explicitly; without a toolchain, these steps can fail (or run with an unexpected version). Add a Rust toolchain setup step before running cargo commands.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +45
echo "npm=false" >> "$GITHUB_OUTPUT"
fi

# Go modules — detect via go.mod (not go.sum, which may not exist)
if find . -name 'go.mod' -not -path '*/vendor/*' | grep -q .; then
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

Go ecosystem detection is based on finding go.sum, but the audit step enumerates go.mod files. Repos can have go.mod without a committed go.sum, in which case this workflow would skip Go auditing. Detect using go.mod (or both) to match the audit logic.

Copilot uses AI. Check for mistakes.
DJ and others added 2 commits April 3, 2026 11:52
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@don-petry don-petry merged commit 9569f8c into main Apr 4, 2026
7 checks passed
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