diff --git a/.github/policies/labelAdded.manifestSingletonDeprecated.yml b/.github/policies/labelAdded.manifestSingletonDeprecated.yml new file mode 100644 index 0000000000000..733e4f8a72d8f --- /dev/null +++ b/.github/policies/labelAdded.manifestSingletonDeprecated.yml @@ -0,0 +1,40 @@ +id: labelAdded.manifestSingletonDeprecated +name: GitOps.PullRequestIssueManagement +description: Handlers when "Manifest-Singleton-Deprecated" label is added +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: >- + When the label "Manifest-Singleton-Deprecated" is added to a pull request + * Add the PR specific reply notifying the issue author + * Assign to the Author + * Label with Needs-Author-Feedback + * Remove the Needs-Attention Label + if: + - payloadType: Pull_Request + - labelAdded: + label: Manifest-Singleton-Deprecated + then: + - addReply: + reply: >- + Hello @${issueAuthor}, + + + The package manager bot determined that your submission uses a `Singleton` Manifest, which been deprecated in this repository. Please update your submission to use the newer multi-manifest format. If you built your manifest by hand, a tool like [WingetCreate](https://github.com/microsoft/winget-create) or [YamlCreate](https://github.com/microsoft/winget-pkgs/blob/master/doc/tools/YamlCreate.md) can help you build the multi-manifest. + + + Template: msftbot/validationError/manifest/singleton/deprecated + - assignTo: + author: True + - addLabel: + label: Needs-Author-Feedback + - removeLabel: + label: Needs-Attention + # The policy service should trigger even when the label was added by the policy service + triggerOnOwnActions: true +onFailure: +onSuccess: diff --git a/.github/policies/labelAdded.manifestVersionDeprecated.yml b/.github/policies/labelAdded.manifestVersionDeprecated.yml index f2a4818c1860b..2a9adb97adc78 100644 --- a/.github/policies/labelAdded.manifestVersionDeprecated.yml +++ b/.github/policies/labelAdded.manifestVersionDeprecated.yml @@ -9,7 +9,7 @@ configuration: resourceManagementConfiguration: eventResponderTasks: - description: >- - When the label "Manifest-Version-Error" is added to a pull request + When the label "Manifest-Version-Deprecated" is added to a pull request * Add the PR specific reply notifying the issue author * Assign to the Author * Label with Needs-Author-Feedback diff --git a/.github/policies/labelManagement.issueOpened.yml b/.github/policies/labelManagement.issueOpened.yml index 8afa7ee24d790..62e504d93a964 100644 --- a/.github/policies/labelManagement.issueOpened.yml +++ b/.github/policies/labelManagement.issueOpened.yml @@ -206,5 +206,35 @@ configuration: then: - addLabel: label: Author-Not-Authorized + - description: >- + When a PR is opened/updated, if + * The files are in /manifests + * The files match *.yaml + * The files do not match *.installer.yaml + * The files do no match *.locale.yaml + Then + * Add label Manifest-Singleton-Deprecated + if: + - payloadType: Pull_Request + - isOpen + - or: + - isAction: + action: Opened + - isAction: + action: Synchronize + - not: + filesMatchPattern: # has at least one file + pattern: ^$ + - filesMatchPattern: + pattern: ^manifests/.*\.yaml # matches manifests/*.yaml + - not: + filesMatchPattern: + pattern: ^manifests/.*\.installer\.yaml # matches manifests/*.installer.yaml + - not: + filesMatchPattern: + pattern: ^manifests/.*\.locale\..*\.yaml # matches manifests/*.locale.*.yaml + then: + - addLabel: + label: Manifest-Singleton-Deprecated onFailure: onSuccess: