From 925bd27c23d4c0fc3a4bee678b8a004b4010f152 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 28 May 2024 10:31:26 -0700 Subject: [PATCH] only auto-merge when author is dotnet-policy-service (#41092) --- .github/policies/auto-merge.yml | 22 +++++++++++++--------- .github/policies/label-prs.yml | 15 +++++++++++++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/policies/auto-merge.yml b/.github/policies/auto-merge.yml index fa5ff76dea57c..e13eb1cd30955 100644 --- a/.github/policies/auto-merge.yml +++ b/.github/policies/auto-merge.yml @@ -19,26 +19,29 @@ configuration: then: - enableAutoMerge: mergeMethod: Squash - - description: Auto-merge PRs to live with title "Merge main into live" + - description: Auto-merge PRs to live labeled with auto-merge triggerOnOwnActions: true if: - payloadType: Pull_Request - - isAction: - action: Opened - - titleContains: - pattern: Merge main into live - isRegex: False + - labelAdded: + label: ':octocat: auto-merge' - targetsBranch: branch: live then: - enableAutoMerge: mergeMethod: Merge - - description: Auto-merge PRs to live labeled with auto-merge + - description: Auto-merge PRs to live with title "Merge main into live" triggerOnOwnActions: true if: - payloadType: Pull_Request - - labelAdded: - label: ':octocat: auto-merge' + - isAction: + action: Opened + - isActivitySender: + user: dotnet-policy-service + issueAuthor: False + - titleContains: + pattern: Merge main into live + isRegex: False - targetsBranch: branch: live then: @@ -51,3 +54,4 @@ configuration: label: ':octocat: auto-merge' then: - disableAutoMerge + diff --git a/.github/policies/label-prs.yml b/.github/policies/label-prs.yml index bf2961146b7ed..42232d8275601 100644 --- a/.github/policies/label-prs.yml +++ b/.github/policies/label-prs.yml @@ -39,6 +39,21 @@ configuration: then: - addLabel: label: community-contribution + - description: Label main to live PRs + triggerOnOwnActions: true + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - isActivitySender: + user: dotnet-policy-service + issueAuthor: False + - titleContains: + pattern: Merge main into live + isRegex: False + then: + - addLabel: + label: ':octocat: auto-merge' - description: Label PRs from the Azure SDK bot if: - payloadType: Pull_Request