Interview Prep/CI/CD/GitHub Actions

A bot should auto-merge Dependabot patch updates when CI passes.

BeginnerScenarioGitHub Actions
Answer

Situation read → Automate low-risk updates safely.

What I'd do →

  1. Use dependabot/fetch-metadata to read update-type.
  2. If version-update:semver-patch, run gh pr merge --auto --squash "$PR_URL" with GH_TOKEN and pull-requests: write.
  3. Enable "Allow auto-merge" and required checks on the repo.

Why → Auto-merge waits for required checks, so a failing update is never merged.

Interview tip → Limit to patch/minor of dev dependencies first.

All CI/CD questions

More on GitHub Actions