diff --git a/.github/policies/pulls-00-checklist.yml b/.github/policies/pulls-01-checklist.yml similarity index 92% rename from .github/policies/pulls-00-checklist.yml rename to .github/policies/pulls-01-checklist.yml index 0ab22a7f4..1e8f05f84 100644 --- a/.github/policies/pulls-00-checklist.yml +++ b/.github/policies/pulls-01-checklist.yml @@ -1,4 +1,4 @@ -id: pulls-00-checklist +id: pulls-01-checklist name: GitOps.PullRequestIssueManagement description: Handles when a PR is opened with specific notes from the checklist owner: @@ -19,7 +19,7 @@ configuration: then: # spaces in markdown checkbox - if: - - commentContains: + - bodyContains: pattern: '^\s*- \[(\s*x\s+|\s+x\s*)\] ' isRegex: true then: @@ -29,7 +29,7 @@ configuration: # spell-checker:disable # no space in markdown checkbox - if: - - commentContains: + - bodyContains: pattern: '^\s*- \[\] ' isRegex: true then: @@ -39,13 +39,13 @@ configuration: # spell-checker:disable # breaking change - if: - - commentContains: + - bodyContains: pattern: '[x] 🚨 This is a breaking change' then: - addLabel: label: 'Breaking change 🚨' - if: - - commentContains: + - bodyContains: pattern: '[ ] 🚨 This is a breaking change' then: - removeLabel: @@ -56,13 +56,13 @@ configuration: # spell-checker:disable # micro PR - if: - - commentContains: + - bodyContains: pattern: '[x] 🤏 The change is less than 20 lines' then: - addLabel: label: 'Micro PR 🔬' - if: - - commentContains: + - bodyContains: pattern: '[ ] 🤏 The change is less than 20 lines' then: - removeLabel: diff --git a/.github/policies/pulls-00-file-paths.yml b/.github/policies/pulls-02-reviewers.yml similarity index 70% rename from .github/policies/pulls-00-file-paths.yml rename to .github/policies/pulls-02-reviewers.yml index 75c0265a6..442486034 100644 --- a/.github/policies/pulls-00-file-paths.yml +++ b/.github/policies/pulls-02-reviewers.yml @@ -1,4 +1,4 @@ -+id: pulls-00-file-paths +id: pulls-02-reviewers name: GitOps.PullRequestIssueManagement description: Handles when a PR is opened with specific file paths owner: @@ -10,100 +10,6 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: When a PR is reviewed, add as review contributor - if: - - or: - - payloadType: Pull_Request_Review - - payloadType: Pull_Request_Review_Comment - - or: - - isAction: - action: Submitted # for reviews - - isAction: - action: Created # for comments - - not: - targetsBranch: - branch: main - - isActivitySender: - issueAuthor: false - - not: - or: - - isActivitySender: - user: allcontributors - - isActivitySender: - user: aromano2 - - isActivitySender: - user: benshy - - isActivitySender: - user: flanakin - - isActivitySender: - user: helderpinto - - isActivitySender: - user: msbrett - - isActivitySender: - user: springstone - then: - - addReply: - reply: '@all-contributors please add ${contextualAuthor} for review' - - description: When a PR is closed, add as contributor - if: - - payloadType: Pull_Request - - isAction: - action: Closed - - not: - targetsBranch: - branch: main - then: - # all code - - if: - - or: - - filesMatchPattern: - pattern: ^(.build|.github|.vscode|src\/scripts)\/.* - - filesMatchPattern: - pattern: ^src\/.* - - not: - or: - - isActivitySender: - user: aromano2 - - isActivitySender: - user: arthurclares - - isActivitySender: - user: didayal-msft - - isActivitySender: - user: flanakin - - isActivitySender: - user: msbrett - - isActivitySender: - user: nteyan - - isActivitySender: - user: saadmsft - - isActivitySender: - user: sebassem - - isActivitySender: - user: springstone - then: - - addReply: - reply: '@all-contributors please add ${issueAuthor} for code' - # docs - - if: - - filesMatchPattern: - pattern: ^(docs|docs-mslearn|docs-wiki)\/.* - - not: - or: - - isActivitySender: - user: aromano2 - - isActivitySender: - user: benshy - - isActivitySender: - user: flanakin - - isActivitySender: - user: helderpinto - - isActivitySender: - user: msbrett - - isActivitySender: - user: springstone - then: - - addReply: - reply: '@all-contributors please add ${issueAuthor} for doc' - description: When a PR is opened, add labels based on file paths if: - payloadType: Pull_Request diff --git a/.github/policies/pulls-02-feedback.yml b/.github/policies/pulls-03-feedback.yml similarity index 98% rename from .github/policies/pulls-02-feedback.yml rename to .github/policies/pulls-03-feedback.yml index 3f1536f39..90680beef 100644 --- a/.github/policies/pulls-02-feedback.yml +++ b/.github/policies/pulls-03-feedback.yml @@ -1,4 +1,4 @@ -id: pulls-02-feedback +id: pulls-03-feedback name: GitOps.PullRequestIssueManagement description: Handles when a PR gets feedback owner: diff --git a/.github/policies/pulls-03-respond.yml b/.github/policies/pulls-04-respond.yml similarity index 98% rename from .github/policies/pulls-03-respond.yml rename to .github/policies/pulls-04-respond.yml index 3f4b0a59a..fbbbd026f 100644 --- a/.github/policies/pulls-03-respond.yml +++ b/.github/policies/pulls-04-respond.yml @@ -1,4 +1,4 @@ -id: pulls-03-respond +id: pulls-04-respond name: GitOps.PullRequestIssueManagement description: Handles when PR feedback is responded to owner: diff --git a/.github/policies/pulls-04-approve.yml b/.github/policies/pulls-05-approve.yml similarity index 98% rename from .github/policies/pulls-04-approve.yml rename to .github/policies/pulls-05-approve.yml index b35de49f6..16c94b6ef 100644 --- a/.github/policies/pulls-04-approve.yml +++ b/.github/policies/pulls-05-approve.yml @@ -1,4 +1,4 @@ -id: pulls-04-approve +id: pulls-05-approve name: GitOps.PullRequestIssueManagement description: Handles when PR is approved owner: diff --git a/.github/policies/pulls-06-contrib.yml b/.github/policies/pulls-06-contrib.yml new file mode 100644 index 000000000..8cf193001 --- /dev/null +++ b/.github/policies/pulls-06-contrib.yml @@ -0,0 +1,108 @@ +id: pulls-06-contrib +name: GitOps.PullRequestIssueManagement +description: Handles when a PR is opened with specific file paths +owner: +resource: repository +disabled: false +where: + +# spell-checker:disable +configuration: + resourceManagementConfiguration: + eventResponderTasks: + - description: When a PR is reviewed, add as review contributor + if: + - or: + - payloadType: Pull_Request_Review + - payloadType: Pull_Request_Review_Comment + - or: + - isAction: + action: Submitted # for reviews + - isAction: + action: Created # for comments + - not: + targetsBranch: + branch: main + - isActivitySender: + issueAuthor: false + - not: + or: + - isActivitySender: + user: allcontributors + - isActivitySender: + user: aromano2 + - isActivitySender: + user: benshy + - isActivitySender: + user: flanakin + - isActivitySender: + user: helderpinto + - isActivitySender: + user: msbrett + - isActivitySender: + user: springstone + then: + - addReply: + reply: '@all-contributors please add ${contextualAuthor} for review' + - description: When a PR is closed, add as contributor + if: + - payloadType: Pull_Request + - isAction: + action: Closed + - not: + targetsBranch: + branch: main + then: + # all code + - if: + - or: + - filesMatchPattern: + pattern: ^(\.build|\.github|\.vscode|src\/scripts)\/.* + - filesMatchPattern: + pattern: ^src\/.* + - not: + or: + - isActivitySender: + user: aromano2 + - isActivitySender: + user: arthurclares + - isActivitySender: + user: didayal-msft + - isActivitySender: + user: flanakin + - isActivitySender: + user: msbrett + - isActivitySender: + user: nteyan + - isActivitySender: + user: saadmsft + - isActivitySender: + user: sebassem + - isActivitySender: + user: springstone + then: + - addReply: + reply: '@all-contributors please add ${issueAuthor} for code' + # docs + - if: + - filesMatchPattern: + pattern: ^(docs|docs-mslearn|docs-wiki)\/.* + - not: + or: + - isActivitySender: + user: aromano2 + - isActivitySender: + user: benshy + - isActivitySender: + user: flanakin + - isActivitySender: + user: helderpinto + - isActivitySender: + user: msbrett + - isActivitySender: + user: springstone + then: + - addReply: + reply: '@all-contributors please add ${issueAuthor} for doc' +onFailure: +onSuccess: