Skip to content

ci: auto-format dependabot PRs using existing black configuration#2854

Closed
jaiswalism wants to merge 1 commit intomandiant:masterfrom
jaiswalism:ci/black-auto-format
Closed

ci: auto-format dependabot PRs using existing black configuration#2854
jaiswalism wants to merge 1 commit intomandiant:masterfrom
jaiswalism:ci/black-auto-format

Conversation

@jaiswalism
Copy link
Copy Markdown

@jaiswalism jaiswalism commented Feb 13, 2026

This PR adds a workflow that automatically runs Black on Dependabot PRs and commits formatting changes back to the same branch when required.

Motivation

When Dependabot updates Black (or other dependencies affecting formatting), CI can fail due to formatting differences. Reviewers currently need to manually run Black and push a follow-up commit. This workflow removes that friction by auto-formatting the PR using the project's existing configuration.

Implementation Details

  • Runs only on dependabot[bot] pull requests.
  • Reuses the existing Black configuration via pre-commit run black, ensuring consistency with the tests.yml CI job.
  • Uses pinned action SHAs, following repository workflow conventions.
  • Installs dependencies the same way as tests.yml to maintain environment parity.
  • Commits changes only if formatting differences are detected.
  • Does not affect human-authored PRs.

Closes #2827


Checklist

  • No CHANGELOG update needed
  • No new tests needed
  • No documentation update needed

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Feb 13, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@mike-hunhoff
Copy link
Copy Markdown
Collaborator

superseded by #2992

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.

CI: black create auto-format workflow

2 participants