Draft
Conversation
Introduce a new GitHub Actions workflow to automatically merge Dependabot pull requests. The workflow triggers on Dependabot PR events and manual dispatch, streamlining dependency update merges. Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new GitHub Actions workflow to automatically merge eligible Dependabot pull requests by delegating to a centralized shared workflow, with support for both automatic triggers and manual dispatch. Sequence diagram for Dependabot auto-merge reusable workflow invocationsequenceDiagram
actor DependabotBot
actor Maintainer
participant Repo
participant GitHub_Actions
participant Dependabot_Automerge_Workflow
participant Shared_Automerge_Workflow
participant GitHub_API
rect rgb(235, 245, 255)
DependabotBot->>Repo: Open or update PR
Repo-->>GitHub_Actions: pull_request_target event
GitHub_Actions->>Dependabot_Automerge_Workflow: Start workflow (event pull_request_target)
Dependabot_Automerge_Workflow->>Dependabot_Automerge_Workflow: Check if github.actor == dependabot_bot
alt Actor is Dependabot bot
Dependabot_Automerge_Workflow->>Shared_Automerge_Workflow: Reusable workflow call
Note over Dependabot_Automerge_Workflow,Shared_Automerge_Workflow: with pull-request-number = github.event.pull_request.number
Shared_Automerge_Workflow->>GitHub_API: Validate and merge Dependabot PR
GitHub_API-->>Shared_Automerge_Workflow: Merge result
Shared_Automerge_Workflow-->>Dependabot_Automerge_Workflow: Completion status
else Actor is not Dependabot bot
Dependabot_Automerge_Workflow-->>GitHub_Actions: Job skipped by if condition
end
end
rect rgb(235, 255, 235)
Maintainer->>GitHub_Actions: workflow_dispatch with pull-request-number
GitHub_Actions->>Dependabot_Automerge_Workflow: Start workflow (event workflow_dispatch)
Dependabot_Automerge_Workflow->>Dependabot_Automerge_Workflow: github.event_name == workflow_dispatch
Dependabot_Automerge_Workflow->>Shared_Automerge_Workflow: Reusable workflow call
Note over Dependabot_Automerge_Workflow,Shared_Automerge_Workflow: with pull-request-number = inputs.pull-request-number
Shared_Automerge_Workflow->>GitHub_API: Validate and merge PR
GitHub_API-->>Shared_Automerge_Workflow: Merge result
Shared_Automerge_Workflow-->>Dependabot_Automerge_Workflow: Completion status
end
Flow diagram for Dependabot auto-merge workflow control logicflowchart TD
A["Workflow triggered\n(pull_request_target or workflow_dispatch)"] --> B{Event type}
B -->|pull_request_target| C{github.actor == dependabot_bot}
B -->|workflow_dispatch| D["Job allowed by condition\n(github.event_name == workflow_dispatch)"]
C -->|false| E["Skip job\n(if condition not met)"]
C -->|true| F["Job runs for Dependabot PR"]
D --> G["Select pull-request-number = inputs.pull-request-number"]
F --> H["Select pull-request-number = github.event.pull_request.number"]
H --> I["Call shared automerge workflow\nwith pull-request-number and repository"]
G --> I
I --> J["Shared workflow validates and merges PR"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Workflow
Notes
Test plan
🌿 Generated by Terry
ℹ️ Tag @terragon-labs to ask questions and address PR feedback
📎 Task: https://www.terragonlabs.com/task/06808823-d3ae-451a-bb45-bd25005c7ce2
Summary by Sourcery
Add a GitHub Actions workflow to automatically merge eligible Dependabot pull requests using a shared automerge workflow.
CI: