Skip to content
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

feat: auto approve bot prs #26

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

mohnoor94
Copy link
Member

Situation

The repository currently requires 2 approvals for all pull requests. However, to reduce friction, only 1 approval should be required for pull requests made by bot accounts like Dependabot and Renovate.

Task

The goal is to configure the repository to automatically provide the first approval for pull requests made by trusted bot accounts while requiring a second human approval before merging.

Action

A GitHub Actions workflow was created in the .github/workflows/pr-auto-approve.yml file. This workflow:

  1. Runs on all pull request events
  2. Check if the pull request author is one of the trusted bot accounts (Dependabot, Renovate)
  3. If so, it automatically provides the first approval using the hmarr/auto-approve-action

Testing

Tested manually on another repo.

Results

With this configuration, pull requests from trusted bot accounts will only require 1 additional human approval before merging, instead of the usual 2. This reduces friction for routine updates while maintaining a level of human review.

@mohnoor94 mohnoor94 requested a review from a team as a code owner November 13, 2024 14:58
@mohnoor94 mohnoor94 enabled auto-merge (squash) November 14, 2024 11:54
@mohnoor94 mohnoor94 merged commit ce9e04e into main Nov 14, 2024
1 check passed
@mohnoor94 mohnoor94 deleted the mohnoor94/SDK-1557/auto-approve-bot-prs branch November 14, 2024 11:57
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.

3 participants