-
Notifications
You must be signed in to change notification settings - Fork 0
Skip templated dependency audit on Dependabot PRs #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Scheduled dependency audit | ||
|
|
||
| # CI skips `make audit` on Dependabot pull requests so that newly published | ||
| # advisories against the existing lockfile cannot block unrelated dependency | ||
| # bumps. This scheduled run is the compensating control: it audits the | ||
| # default branch weekly so anything that slips through surfaces within days. | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '11 7 * * 1' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| audit: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| {% if use_rust %} | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| {% endif %} | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | ||
| with: | ||
| python-version: '3.13' | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5 | ||
|
|
||
| {% if use_rust %} | ||
| - name: Set up Rust | ||
| uses: leynos/shared-actions/.github/actions/setup-rust@455d9ed03477c0026da96c2541ca26569a74acac | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Install cargo-audit | ||
| env: | ||
| RUSTFLAGS: "" | ||
| run: cargo install --locked cargo-audit | ||
|
|
||
| {% endif %} | ||
| - name: Audit dependencies | ||
| run: make audit | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,12 @@ jobs: | |
| - name: Run typechecker | ||
| run: make typecheck | ||
|
|
||
| # Dependency audits report advisories against the whole lockfile, so a | ||
| # newly published advisory would fail every Dependabot PR regardless of | ||
| # content and deadlock auto-merge. The scheduled audit workflow covers | ||
| # Dependabot merges instead. | ||
| - name: Audit dependencies | ||
| if: github.actor != 'dependabot[bot]' | ||
| run: make audit | ||
|
Comment on lines
85
to
87
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win Assert the guard condition explicitly in the CI contract test.
🤖 Prompt for AI Agents |
||
|
|
||
| - name: Test and Measure Coverage | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win
Bound the job with
timeout-minutes.The job has no
timeout-minutes, so a stuckcargo install,uvinstall, orpip-auditadvisory-database fetch will occupy the runner up to GitHub's default six-hour ceiling before this weekly compensating control even reports a failure. Cap it.⏱️ Proposed fix
audit: runs-on: ubuntu-latest + timeout-minutes: 15 {% if use_rust %}📝 Committable suggestion
🤖 Prompt for AI Agents