From b27e4fcb35da2b4f8c893e767f2222ba49ea6b09 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:44:03 -0700 Subject: [PATCH 1/6] try to fix what I broke --- .github/policies/disallow-edits.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 5769018a468..64b241a77ea 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -8,6 +8,8 @@ configuration: - description: Close PRs that modify files whose "source of truth" is not in this repo. if: - payloadType: Pull_Request + - isAction: + action: Opened - or: - includesModifiedFiles: files: @@ -52,4 +54,5 @@ configuration: permission: write - activitySenderHasPermission: permission: admin + then: - closePullRequest From 3adbed25ba39430c9b7643cea5c5659a50cb0319 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 18:59:03 -0700 Subject: [PATCH 2/6] try to fix validation --- .github/policies/disallow-edits.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 64b241a77ea..4f8754fd4ff 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -47,12 +47,3 @@ configuration: - addReply: reply: >- @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. - - if: - - not: - - or: - - activitySenderHasPermission: - permission: write - - activitySenderHasPermission: - permission: admin - then: - - closePullRequest From 4ed5407c2e7635552f8c6f8602f5562f30fe75b5 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:01:12 -0700 Subject: [PATCH 3/6] add back --- .github/policies/disallow-edits.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 4f8754fd4ff..d1ea5f34590 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -47,3 +47,12 @@ configuration: - addReply: reply: >- @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. + if: + - not: + - or: + - activitySenderHasPermission: + permission: write + - activitySenderHasPermission: + permission: admin + then: + - closePullRequest From 29fe2a0916503242f5a8247ffdff53c3b1141ddf Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:03:40 -0700 Subject: [PATCH 4/6] capitalize --- .github/policies/disallow-edits.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index d1ea5f34590..1d80543fba9 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -47,12 +47,12 @@ configuration: - addReply: reply: >- @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. - if: + - if: - not: - or: - activitySenderHasPermission: - permission: write + permission: Write - activitySenderHasPermission: - permission: admin + permission: Admin then: - closePullRequest From ebbed073ee604653be93df1edf1acd7d6bd26928 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:09:39 -0700 Subject: [PATCH 5/6] try again --- .github/policies/disallow-edits.yml | 105 ++++++++++++++-------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index 1d80543fba9..abd0b1abce3 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -3,56 +3,55 @@ description: GitOps.PullRequestIssueManagement primitive resource: repository configuration: - resourceManagementConfiguration: - eventResponderTasks: - - description: Close PRs that modify files whose "source of truth" is not in this repo. - if: - - payloadType: Pull_Request - - isAction: - action: Opened - - or: - - includesModifiedFiles: - files: - - xml/Microsoft.Extensions*/* - excludedFiles: - # These files use this repo as source-of-truth. - - xml/Microsoft.Extensions.FileSystemGlobbing/* - - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* - - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* - - includesModifiedFiles: - files: - - xml/System.Composition/* - - includesModifiedFiles: - files: - - xml/System.Formats.Cbor/* - - includesModifiedFiles: - files: - - xml/System.Formats.Nrbf/* - - includesModifiedFiles: - files: - - xml/System.Net.ServerSentEvents/* - - includesModifiedFiles: - files: - - xml/System.Numerics.Tensors/* - - includesModifiedFiles: - files: - - xml/System.Speech/* - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml - - includesModifiedFile: - file: xml/System.Runtime.Serialization/ImportOptions.xml - - includesModifiedFile: - file: xml/System.Runtime.Serialization/XsdDataContractExporter.xml - then: - - addReply: - reply: >- - @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. - - if: - - not: - - or: - - activitySenderHasPermission: - permission: Write - - activitySenderHasPermission: - permission: Admin - then: - - closePullRequest + resourceManagementConfiguration: + eventResponderTasks: + - description: Close PRs that modify files whose "source of truth" is not in this repo. + if: + - payloadType: Pull_Request + - isAction: + action: Opened + - or: + - includesModifiedFiles: + files: + - xml/Microsoft.Extensions*/* + excludedFiles: + # These files use this repo as source-of-truth. + - xml/Microsoft.Extensions.FileSystemGlobbing/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Abstractions/* + - xml/Microsoft.Extensions.FileSystemGlobbing.Internal*/* + - includesModifiedFiles: + files: + - xml/System.Composition/* + - includesModifiedFiles: + files: + - xml/System.Formats.Cbor/* + - includesModifiedFiles: + files: + - xml/System.Formats.Nrbf/* + - includesModifiedFiles: + files: + - xml/System.Net.ServerSentEvents/* + - includesModifiedFiles: + files: + - xml/System.Numerics.Tensors/* + - includesModifiedFiles: + files: + - xml/System.Speech/* + - includesModifiedFile: + file: xml/System.Runtime.Serialization/ISerializationCodeDomSurrogateProvider.xml + - includesModifiedFile: + file: xml/System.Runtime.Serialization/ImportOptions.xml + - includesModifiedFile: + file: xml/System.Runtime.Serialization/XsdDataContractExporter.xml + then: + - addReply: + reply: >- + @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. + if: + - or: + - activitySenderHasPermission: + permission: None + - activitySenderHasPermission: + permission: Read + then: + - closePullRequest From 124eb4fbc6129246de6a2537c594e8ff854cfe52 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 27 Sep 2024 19:10:43 -0700 Subject: [PATCH 6/6] try again --- .github/policies/disallow-edits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/policies/disallow-edits.yml b/.github/policies/disallow-edits.yml index abd0b1abce3..ee9f6a9089f 100644 --- a/.github/policies/disallow-edits.yml +++ b/.github/policies/disallow-edits.yml @@ -47,7 +47,7 @@ configuration: - addReply: reply: >- @${issueAuthor} - This PR edits files whose 'source of truth' for documentation is not in this repo. If you're editing the documentation, please make these updates in the /// comments in the source repo (either dotnet/runtime or dotnet/extensions) instead. - if: + - if: - or: - activitySenderHasPermission: permission: None