diff --git a/.github/policies/auto-label-pr.yml b/.github/policies/auto-label-pr.yml new file mode 100644 index 00000000..d591d513 --- /dev/null +++ b/.github/policies/auto-label-pr.yml @@ -0,0 +1,82 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: Label community PRs + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - and: + - not: + activitySenderHasPermission: + permission: Admin + - not: + activitySenderHasPermission: + permission: Write + - not: + isActivitySender: + user: github-actions[bot] + - not: + isActivitySender: + user: github-actions + - not: + isActivitySender: + user: azure-sdk + - not: + isActivitySender: + user: dependabot + - not: + isActivitySender: + user: microsoft-github-policy-service[bot] + then: + - addLabel: + label: community-contribution + + - description: Label ref docs sync PRs from the microsoft-github-policy-service bot + triggerOnOwnActions: true + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - isActivitySender: + user: microsoft-github-policy-service[bot] + - titleContains: + pattern: Merge smoke-test into main + isRegex: False + then: + - addLabel: + label: ":octocat: auto-merge" + + - description: Label prod sync PRs from the microsoft-github-policy-service bot + triggerOnOwnActions: true + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - isActivitySender: + user: microsoft-github-policy-service[bot] + - titleContains: + pattern: Merge main into live + isRegex: False + then: + - addLabel: + label: ":octocat: auto-merge" + + - description: Label PRs from dependabot/dependabot[bot] + if: + - payloadType: Pull_Request + - or: + - isActivitySender: + user: dependabot + - isActivitySender: + user: dependabot[bot] + then: + - addLabel: + label: ":octocat: auto-merge"