Skip to content
This repository was archived by the owner on Apr 9, 2026. It is now read-only.

chore: add Dependabot security-only update config#1

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

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

Conversation

@don-petry
Copy link
Copy Markdown
Owner

Summary

  • Add .github/dependabot.yml with weekly schedules for pip and github-actions ecosystems, labeled security + dependencies
  • Add dependabot-automerge workflow to auto-approve and squash-merge patch/minor/indirect Dependabot PRs (major updates left for human review)
  • Add dependency-audit workflow that runs pip-audit on PRs and pushes to main, failing the build on known vulnerabilities

This aligns context-scribe with the petry-projects org standard of security-only dependency updates for application repositories.

Test plan

  • Verify Dependabot opens PRs with security and dependencies labels
  • Confirm auto-merge workflow triggers on Dependabot PRs and correctly gates on update type
  • Confirm dependency-audit workflow detects pyproject.toml and runs pip-audit
  • Add dependency-audit as a required status check in branch protection settings

🤖 Generated with Claude Code

Add org-standard Dependabot configuration for security-focused dependency
management (pip + github-actions ecosystems), auto-merge workflow for
patch/minor updates, and dependency vulnerability audit workflow.

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:38
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 automate dependency security management for this repository (scheduled Dependabot updates, automatic merging of eligible Dependabot PRs, and CI-time vulnerability auditing).

Changes:

  • Add .github/dependabot.yml for scheduled pip and github-actions updates with default labels.
  • Add dependabot-automerge workflow to auto-approve and squash-merge certain Dependabot PRs.
  • Add dependency-audit workflow to detect ecosystems and run audit tooling (including pip-audit).

Reviewed changes

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

File Description
.github/workflows/dependency-audit.yml Adds a multi-ecosystem dependency vulnerability audit workflow (includes pip-audit).
.github/workflows/dependabot-automerge.yml Adds a Dependabot PR auto-approve/merge workflow using a GitHub App token.
.github/dependabot.yml Adds Dependabot schedules/labels for pip + GitHub Actions updates.

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

@@ -0,0 +1,136 @@
# Dependency vulnerability audit
# Copy to .github/workflows/dependency-audit.yml
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.

Header comment says "Copy to .github/workflows/dependency-audit.yml" but this file is already at that path, so the instruction is misleading/outdated. Please remove or update the header comment to avoid confusion for maintainers.

Suggested change
# Copy to .github/workflows/dependency-audit.yml

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +46
# Go modules
if find . -name 'go.sum' | grep -q .; then
echo "gomod=true" >> "$GITHUB_OUTPUT"
else
echo "gomod=false" >> "$GITHUB_OUTPUT"
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.

Go module detection checks for go.sum, but Go modules can exist with go.mod and no go.sum yet (e.g., fresh module or tidy not run), causing govulncheck to be skipped incorrectly. Detect based on go.mod instead (similar to how the audit step enumerates go.mod).

Copilot uses AI. Check for mistakes.
- name: Audit Python dependencies
run: |
if [ -f "pyproject.toml" ]; then
pip-audit --require-hashes=false
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.

pip-audit --require-hashes=false is very likely an invalid CLI invocation (pip-audit’s --require-hashes is a boolean flag, not a key=value option). As written, this step may fail immediately; if the intent is to not require hashes, drop the flag entirely (or use the supported form).

Suggested change
pip-audit --require-hashes=false
pip-audit

Copilot uses AI. Check for mistakes.
Comment on lines +127 to +134
- name: Install pip-audit
run: pip install pip-audit

- name: Audit Python dependencies
run: |
if [ -f "pyproject.toml" ]; then
pip-audit --require-hashes=false
elif [ -f "requirements.txt" ]; 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.

For pyproject.toml projects, this workflow installs only pip-audit but does not install the project (or its dependencies) before running the audit. In that case pip-audit will typically audit only the current environment (mostly just pip-audit itself) and miss the application dependencies declared in pyproject.toml. Install the project (e.g., pip install -e . or equivalent) before running pip-audit, or use a pip-audit mode that reads dependencies directly from the project metadata if supported.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,57 @@
# Dependabot auto-merge workflow
# Copy to .github/workflows/dependabot-automerge.yml
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.

Header comment says "Copy to .github/workflows/dependabot-automerge.yml" but this file is already located there, so the instruction is misleading/outdated. Please remove or update the header comment.

Suggested change
# Copy to .github/workflows/dependabot-automerge.yml

Copilot uses AI. Check for mistakes.
steps.metadata.outputs.dependency-type == 'indirect'
run: |
gh pr review --approve "$PR_URL"
gh pr merge --squash --admin "$PR_URL"
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.

gh pr merge --admin can bypass branch protection requirements (required checks/reviews), which undermines the goal of gating merges on security/audit results. Consider removing --admin and using gh pr merge --auto --squash (or GitHub auto-merge) so the PR is only merged after required status checks pass.

Suggested change
gh pr merge --squash --admin "$PR_URL"
gh pr merge --auto --squash "$PR_URL"

Copilot uses AI. Check for mistakes.
DJ and others added 2 commits April 3, 2026 11:46
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 bad8382 into main Apr 4, 2026
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants