From 4df23c0b5c777ee31b2f970326bd64191e2bb24a Mon Sep 17 00:00:00 2001 From: "msftbot[bot]" <48340428+msftbot[bot]@users.noreply.github.com> Date: Wed, 27 Jul 2022 18:31:32 +0200 Subject: [PATCH] Migrate FabricBot Tasks to Config-as-Code (#1140) Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com> --- .github/fabricbot.json | 133 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 .github/fabricbot.json diff --git a/.github/fabricbot.json b/.github/fabricbot.json new file mode 100644 index 000000000..582747633 --- /dev/null +++ b/.github/fabricbot.json @@ -0,0 +1,133 @@ +{ + "version": "1.0", + "tasks": [ + { + "taskType": "trigger", + "capabilityId": "AutoMerge", + "subCapability": "AutoMerge", + "version": "1.0", + "config": { + "label": "auto-merge", + "taskName": "Auto-merge pull requests", + "minMinutesOpen": "3", + "mergeType": "squash", + "deleteBranches": true, + "removeLabelOnPush": true, + "requireAllStatuses": true, + "usePrDescriptionAsCommitMessage": true, + "requireAllStatuses_exemptList": [ + "dependabot" + ], + "allowAutoMergeInstructionsWithoutLabel": false, + "conditionalMergeTypes": [], + "enforceDMPAsStatus": true + }, + "id": "JuMdi8HG5hj" + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "id": "2NIutwdw7", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "name": "prTargetsBranch", + "parameters": { + "branchName": "master" + } + }, + { + "name": "activitySenderHasPermissions", + "parameters": { + "permissions": "write" + } + }, + { + "name": "isAction", + "parameters": { + "action": "opened" + } + }, + { + "operator": "or", + "operands": [ + { + "operator": "and", + "operands": [ + { + "name": "titleContains", + "parameters": { + "titlePattern": "Localized file check-in by OneLocBuild Task: Build definition ID 4138: Build ID: Build ID [0-9]+", + "isRegex": true + } + }, + { + "name": "isActivitySender", + "parameters": { + "user": "testplatform-bot" + } + } + ] + }, + { + "operator": "and", + "operands": [ + { + "name": "titleContains", + "parameters": { + "titlePattern": "LEGO\\: Pull request from lego\\/[a-z0-9_\\-]* to master", + "isRegex": true + } + }, + { + "name": "isActivitySender", + "parameters": { + "user": "csigs" + } + } + ] + } + ] + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "taskName": "Auto-merge Localization PRs", + "actions": [ + { + "name": "approvePullRequest", + "parameters": { + "comment": "Localization PR auto-approved." + } + }, + { + "name": "addLabel", + "parameters": { + "label": "localization" + } + }, + { + "name": "addLabel", + "parameters": { + "label": "auto-merge" + } + } + ], + "dangerZone": { + "respondToBotActions": true, + "acceptRespondToBotActions": true + } + } + } + ], + "userGroups": [] +}