Skip to content

feat: experimental AI-assisted Dependabot auto-merge agent#1229

Draft
hjgraca wants to merge 5 commits into
developfrom
feat/dependabot-automerge-agent
Draft

feat: experimental AI-assisted Dependabot auto-merge agent#1229
hjgraca wants to merge 5 commits into
developfrom
feat/dependabot-automerge-agent

Conversation

@hjgraca

@hjgraca hjgraca commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Issue number: #1228

Changes

Adds an experimental, label-triggered workflow that runs an AI agent to
auto-merge low-risk Dependabot PRs. On a PR labelled dependencies authored by
dependabot[bot], the agent judges whether the change is low-risk within an
explicit, in-skill policy — patch/minor only (never major/unknown), combined
CI green, manifest/lockfile-only diff — and if so approves it and enables GitHub
auto-merge (which still waits for all required checks). Otherwise it comments
why and holds the PR for a human.

The agent is the github-pr-label-actions reference architecture from
agentic-sdlc. It works entirely
through the GitHub API and never checks out or runs PR code. It is vendored
in-tree under .github/agents/dependabot-automerge/, so no external source repo
is fetched at run time (its npm deps install from a pinned, integrity-checked
package-lock.json with --ignore-scripts).

Opened as a draft — see the open questions in #1228. Notably:

  • It uses pull_request_target (gated to dependencies + dependabot[bot]),
    whereas this repo otherwise prefers the record_prworkflow_run pattern.
    Happy to rework to that style if preferred.
  • It calls Amazon Bedrock via GitHub OIDC, which requires a team-owned AWS
    account with an OIDC role scoped to Bedrock — provisioning that is a
    prerequisite the team would need to own before this runs beyond an experiment.

User experience

Before: Dependabot dependency PRs (e.g. GitHub-Actions SHA bumps, NuGet
patch/minor) are reviewed and merged manually by maintainers.

After: Clearly-low-risk Dependabot PRs are approved and set to auto-merge
automatically once required checks pass; anything outside the policy is held with
an explanatory comment, so maintainers only look at the ones that need judgement.

Prerequisites (repo settings/variables, not created by this PR):

  • "Allow auto-merge" (Settings → General → Pull Requests)
  • "Allow GitHub Actions to create and approve pull requests" (Settings → Actions → General)
  • Repo variables AWS_ROLE_ARN (Bedrock-only OIDC role) and AWS_REGION

Checklist

  • Meets tenets criteria
  • I have performed a self-review of this change
  • Changes have been tested
  • Changes are documented
  • PR title follows conventional commit semantics

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Adds a label-triggered, one-shot agent that judges whether a Dependabot PR is
low-risk (patch/minor, green CI, lockfile-only diff) within an explicit in-skill
policy, then approves + enables GitHub auto-merge — otherwise holds it for a
human. API-only; never runs PR code. Actions SHA-pinned to the versions already
trusted in secure_workflows.yml.

Tracking issue #1228. Requires repo vars AWS_ROLE_ARN/AWS_REGION and the
auto-merge + Actions-approval repo settings before it can run.
@boring-cyborg boring-cyborg Bot added github-actions Changes in GitHub workflows internal Maintenance changes labels Jun 26, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 26, 2026
@github-actions github-actions Bot added the feature New features or minor changes label Jun 26, 2026
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 26, 2026
Comment thread .github/workflows/dependabot_automerge.yml Fixed
Comment thread .github/workflows/dependabot_automerge.yml Fixed
Removes the run-time dependency on an external repo (degit). The
github-pr-label-actions agent is now committed under
.github/agents/dependabot-automerge/, and the workflow runs it from there with
npm ci (deps pinned + integrity-checked via package-lock). No external source is
fetched at run time. Verified: npm ci + tsc + flue build + npm test (5) green in
the vendored location.
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 26, 2026
Addresses the SonarCloud finding (JavaScript package manager scripts should not
be executed during installation). Verified the vendored agent still installs,
type-checks, builds, tests (5), and runs end-to-end with --ignore-scripts.
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 26, 2026
Object.values() already returns a fresh array; [...Object.values(x)] clones it
unnecessarily. Use Object.values(githubTools) directly.
@powertools-for-aws-oss-automation powertools-for-aws-oss-automation Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features or minor changes github-actions Changes in GitHub workflows internal Maintenance changes size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants