From 565bd00e8f5397a625cc6456eec142a17d86b262 Mon Sep 17 00:00:00 2001 From: Stephen Gillie <114952565+stephengillie@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:00:03 -0800 Subject: [PATCH] Moving to own file. --- .../labelAdded.validationDefenderError.yml | 41 +++++++++++++++++++ .github/policies/wingetbotTriggers.yml | 8 ---- 2 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 .github/policies/labelAdded.validationDefenderError.yml diff --git a/.github/policies/labelAdded.validationDefenderError.yml b/.github/policies/labelAdded.validationDefenderError.yml new file mode 100644 index 0000000000000..5c8e3e3908b1d --- /dev/null +++ b/.github/policies/labelAdded.validationDefenderError.yml @@ -0,0 +1,41 @@ +id: labelAdded.validationDefenderError +name: GitOps.PullRequestIssueManagement +description: Handlers when "Validation-Defender-Error" label is added +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: >- + When the label "Validation-Defender-Error" is added to a pull request + * Add the PR specific reply notifying the issue author + * Close the PR + if: + - payloadType: Pull_Request + - labelAdded: + label: Validation-Defender-Error + then: + - addReply: + reply: >- + Hello @${issueAuthor}, + + + The package manager bot was blocked from installing one of the installers listed in the url field, and cannot continue. + + + The application included in this pull request failed to pass the [Installers Scan](https://docs.microsoft.com/en-us/windows/package-manager/package/winget-validation) test. This test is designed to ensure that the application installs on all environments without warnings. For more details on this error, see [Defender errors](https://learn.microsoft.com/en-us/windows/package-manager/package/repository#error-labels). Please check to ensure the installer URL is correct and update the URL and the Hash if a change is made. + + + Template: msftbot/validationError/installers/validationDefender + - assignTo: + author: True + - addLabel: + label: Needs-Author-Feedback + - removeLabel: + label: Needs-Attention # This will automatically assign the ICM Users + # The policy service should trigger even when the label was added by the policy service + triggerOnOwnActions: true +onFailure: +onSuccess: \ No newline at end of file diff --git a/.github/policies/wingetbotTriggers.yml b/.github/policies/wingetbotTriggers.yml index 472bdd75da139..72c1f7b76af6f 100644 --- a/.github/policies/wingetbotTriggers.yml +++ b/.github/policies/wingetbotTriggers.yml @@ -104,14 +104,6 @@ configuration: label: Needs-Attention # This will automatically assign the ICM Users - removeLabel: label: Needs-Author-Feedback - - description: Close PRs when "Validation-Defender-Error" label is added - if: - - payloadType: Pull_Request - - isOpen - - labelAdded: - label: Validation-Defender-Error - then: - - closeIssue # The policy service should trigger even when the assignment was made by the policy service triggerOnOwnActions: true onFailure: