From f8a20afb91505c9b113d79cf7f263cb76363623e Mon Sep 17 00:00:00 2001 From: "msftbot[bot]" <48340428+msftbot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 10:49:11 -0700 Subject: [PATCH] Migrate FabricBot Tasks to Config-as-Code (#3262) * Add `.github/fabricbot.json` * Clean-up. Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com> Co-authored-by: Pawel Winogrodzki --- .github/fabricbot.json | 141 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 .github/fabricbot.json diff --git a/.github/fabricbot.json b/.github/fabricbot.json new file mode 100644 index 0000000000..aebd1cced8 --- /dev/null +++ b/.github/fabricbot.json @@ -0,0 +1,141 @@ +{ + "version": "1.0", + "tasks": [ + { + "taskType": "trigger", + "capabilityId": "PrAutoLabel", + "subCapability": "Path", + "version": "1.0", + "id": "ldNQNnhTM", + "config": { + "taskName": "Add tags (paths)", + "configs": [ + { + "label": "Packaging", + "pathFilter": [ + "SPECS/", + "SPECS-SIGNED/" + ] + }, + { + "label": "documentation", + "pathFilter": [ + "toolkit/docs/" + ] + }, + { + "label": "Tools", + "pathFilter": [ + "toolkit/tools/", + "toolkit/scripts/" + ] + }, + { + "label": "Schema", + "pathFilter": [ + "toolkit/imageconfigs/", + "toolkit/tools/imagegen/configuration" + ] + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "id": "znSU-jzNE", + "config": { + "taskName": "Apply security tag for CVE patches", + "conditions": { + "operator": "and", + "operands": [ + { + "name": "prMatchesPattern", + "parameters": { + "matchRegex": "(CVE|cve)-\\d+-\\d+\\.(no)?patch" + } + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "actions": [ + { + "name": "addLabel", + "parameters": { + "label": "security" + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "PullRequestResponder", + "version": "1.0", + "id": "7jJOHIRF6", + "config": { + "taskName": "Add label for automatic PRs", + "conditions": { + "operator": "and", + "operands": [ + { + "name": "isAction", + "parameters": { + "action": "opened" + } + }, + { + "name": "isActivitySender", + "parameters": { + "user": "CBL-Mariner-Bot" + } + } + ] + }, + "eventType": "pull_request", + "eventNames": [ + "pull_request", + "issues", + "project_card" + ], + "actions": [ + { + "name": "addLabel", + "parameters": { + "label": "Automatic PR" + } + } + ] + } + }, + { + "taskType": "trigger", + "capabilityId": "PrAutoLabel", + "subCapability": "Branch", + "version": "1.0", + "id": "lBG0b8Sb8Mpdm0byiViDh", + "config": { + "taskName": "Add labels for PRs to common branches", + "configs": [ + { + "label": "1.0-dev", + "branchName": "1.0-dev" + }, + { + "label": "main", + "branchName": "main" + } + ] + } + } + ], + "userGroups": [] +}