diff --git a/.github/policies/pr.dependabot-auto-merge.yml b/.github/policies/pr.dependabot-auto-merge.yml new file mode 100644 index 00000000000..7136ec2b612 --- /dev/null +++ b/.github/policies/pr.dependabot-auto-merge.yml @@ -0,0 +1,37 @@ +id: pr.dependabot-auto-merge +name: GitOps.PullRequestIssueManagement +description: Automatically approve and merge Dependabot updates +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: Approve and auto-merge Dependabot updates + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - targetsBranch: + branch: main + - isActivitySender: + user: dependabot[bot] + issueAuthor: true + then: + - approvePullRequest: + comment: "Approved automatically for a Dependabot update." + - addLabel: + label: auto-merge + - enableAutoMerge: + mergeMethod: Squash + + - description: Disable auto-merge when the auto-merge label is removed + if: + - payloadType: Pull_Request + - labelRemoved: + label: auto-merge + then: + - disableAutoMerge +onFailure: +onSuccess: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe452fe7a69..c096fd166a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -519,12 +519,13 @@ Process labels Misc labels -| Name | Color | Description | -| ------------------- | ------- | -------------------------------------------------- | -| `agentic-workflows` | #000000 | Issues/PR created by github agentic workflows | -| `good first issue` | #7057ff | Good for newcomers | -| `mq` | #0969da | Good candidate for MQ | -| `int:azure-specs` | #0e8a16 | Run integration tests against azure-rest-api-specs | +| Name | Color | Description | +| ------------------- | ------- | ---------------------------------------------------------------- | +| `agentic-workflows` | #000000 | Issues/PR created by github agentic workflows | +| `auto-merge` | #0e8a16 | Automatically merge the pull request after all requirements pass | +| `good first issue` | #7057ff | Good for newcomers | +| `mq` | #0969da | Good candidate for MQ | +| `int:azure-specs` | #0e8a16 | Run integration tests against azure-rest-api-specs | diff --git a/eng/common/config/labels.ts b/eng/common/config/labels.ts index 8935f48cdb8..55cb25d8d1c 100644 --- a/eng/common/config/labels.ts +++ b/eng/common/config/labels.ts @@ -214,6 +214,10 @@ export default defineConfig({ color: "000000", description: "Issues/PR created by github agentic workflows", }, + "auto-merge": { + color: "0e8a16", + description: "Automatically merge the pull request after all requirements pass", + }, "good first issue": { color: "7057ff", description: "Good for newcomers",