Skip to content

Split dependabot-dismiss tooling into composite action + thin wrapper#7

Merged
antunflas merged 6 commits into
mainfrom
feature/dismiss-dev-only-dependabot-alerts
Jul 8, 2026
Merged

Split dependabot-dismiss tooling into composite action + thin wrapper#7
antunflas merged 6 commits into
mainfrom
feature/dismiss-dev-only-dependabot-alerts

Conversation

@antunflas

Copy link
Copy Markdown
Member

What

Splits the dev-only Dependabot dismiss tooling into a shared composite action (the engine) plus a thin reusable-workflow wrapper that calls it. One implementation, two entry points.

Why

The reusable workflow can't accept caller-provided uses: steps. Two projects need project-specific setup between checkout and Gradle configuration (a Vault fetch that supplies a private Maven repo URL), so they can't use it. Rather than bolting a setup-command hook onto the workflow, the pipeline becomes a composite action those projects can call directly with their own pre-steps.

Changes

  • New .github/actions/dismiss-dev-only-dependabot-alerts/action.ymlusing: composite, the single source of truth. Assumes the caller repo is already checked out; does no checkout and no secret setup. app-private-key is an input (composite actions have no secrets: block; still masked when passed from a secret). Resolves the pipeline scripts via $GITHUB_ACTION_PATH, which removes the old tooling-repo token mint + tooling checkout entirely. Self-gates on the open-alert count via steps.alerts.outputs.has-alerts.
  • Slimmed .github/workflows/dismiss-dev-only-dependabot-alerts.ymlworkflow_call interface unchanged. list-alerts gate kept as-is (skips checkout when idle). dismiss job reduced from ~250 lines to: mint token → checkout caller (submodules: recursive) → uses: the action @main.
  • README — documents both usages and when to use each; includes the direct-action snippet with the Vault pre-step.
  • scripts/ untouched. LFS gradle-wrapper materialization preserved (moved into the action).

There is intentional, documented duplication: the wrapper mints a token for checkout and the action mints its own for the API; the alerts fetch happens in list-alerts and again in the action's self-gate. Both are cheap and keep the action self-contained for direct callers.

Note on the @main ref

The wrapper references the action at @main. Since action.yml lands on main only when this PR merges, an end-to-end run of the reusable-workflow path can't be validated from a caller until after merge (the action won't resolve on main before then). Verify via the direct-action path pre-merge, or temporarily point a test caller at the feature ref.

Verification (not yet run)

Both files parse; orchestration YAML is only truly verified by execution:

  1. Trigger the reusable workflow from a no-secrets project → behaves as today (LFS fix intact, dismissal works).
  2. Trigger the direct-action job from Android-RBA (dry-run) → Vault step runs, Gradle configures past "You must specify a URL for a Maven repository", analysis completes.
  3. Confirm a zero-open-alerts run skips the heavy steps.

Out of scope (separate repos / tracked separately): migrating Android-RBA and android-rba-mbiz to the direct action; the mbiz build/dependabot-tools collision when Gradle clears rootProject.buildDir.

🤖 Generated with Claude Code

Extract the dependency-analysis pipeline out of the reusable workflow's
dismiss job into a composite action that is the single source of truth,
and reduce the workflow to a checkout-then-delegate wrapper.

This gives two entry points from one implementation:
- Reusable workflow (unchanged interface) for the 20+ thin callers.
- Composite action, called directly, for projects that must run their
  own pre-steps between checkout and the analysis (e.g. a Vault fetch
  for a private Maven repo URL), which a reusable workflow can't accept.

The action resolves the pipeline scripts via $GITHUB_ACTION_PATH,
removing the separate tooling-repo token mint and tooling checkout. It
self-gates on the open-alert count so direct callers skip the heavy work
when nothing is open; the wrapper keeps its list-alerts gate to avoid
checkout when idle. The LFS gradle-wrapper materialization is preserved.

README documents both usages and when to use each.
Copilot AI review requested due to automatic review settings July 7, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the “dismiss dev-only Dependabot alerts” automation by moving the analysis/dismissal pipeline into a shared composite action and reducing the existing reusable workflow to a thin wrapper that checks out the caller repo and invokes that action. This enables caller repositories to insert custom pre-steps (e.g., Vault fetches) between checkout and Gradle configuration while keeping a simple reusable-workflow entry point for the common case.

Changes:

  • Added a new composite action (.github/actions/dismiss-dev-only-dependabot-alerts/action.yml) that encapsulates the full pipeline and self-gates on open-alert count.
  • Simplified the reusable workflow (.github/workflows/dismiss-dev-only-dependabot-alerts.yml) to: mint checkout token → checkout caller (incl. submodules) → run the composite action.
  • Updated README.md to document the new architecture and provide both “reusable workflow” and “direct action” usage patterns.

Reviewed changes

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

File Description
README.md Documents the new composite-action “engine” + reusable-workflow wrapper architecture and adds a direct-action usage example.
.github/workflows/dismiss-dev-only-dependabot-alerts.yml Refactors the workflow to delegate the analysis/dismissal logic to the new composite action.
.github/actions/dismiss-dev-only-dependabot-alerts/action.yml Introduces the composite action that runs the full pipeline against an already-checked-out workspace and self-gates on open alerts.

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

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 7, 2026 18:55
antunflas and others added 2 commits July 7, 2026 20:57
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .github/actions/dismiss-dev-only-dependabot-alerts/action.yml
Comment thread README.md
Comment thread README.md
Copilot AI review requested due to automatic review settings July 7, 2026 18:57
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread .github/actions/dismiss-dev-only-dependabot-alerts/action.yml
Comment thread .github/workflows/dismiss-dev-only-dependabot-alerts.yml
Copilot AI review requested due to automatic review settings July 7, 2026 19:00
@antunflas antunflas closed this Jul 7, 2026
@antunflas antunflas reopened this Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread .github/actions/dismiss-dev-only-dependabot-alerts/action.yml
Copilot AI review requested due to automatic review settings July 8, 2026 14:29
@antunflas
antunflas merged commit 9a5d054 into main Jul 8, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment on lines +107 to +113
- name: Resolve scripts directory
if: steps.alerts.outputs.has-alerts == 'true'
shell: bash
# This action lives at `.github/actions/dismiss-dev-only-dependabot-alerts`,
# so the pipeline scripts at the repo root are three levels up. Resolving
# them via $GITHUB_ACTION_PATH means we need no separate tooling checkout.
run: echo "SCRIPTS_DIR=$(cd "$GITHUB_ACTION_PATH/../../../scripts" && pwd)" >> "$GITHUB_ENV"
Comment on lines 3 to 6
on:
push:
paths:
- "scripts/**"
- ".github/workflows/test-scripts.yml"
pull_request:
paths:
- "scripts/**"
- ".github/workflows/test-scripts.yml"

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