From d6df31c72a96021e5d9fca3b26d7d3f2bc7854b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Mon, 25 Nov 2024 08:26:41 +0100 Subject: [PATCH 1/3] Update PullRequestStatusCheckController.cs --- .../Controllers/PullRequestStatusCheckController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs index f7afaea..033cc53 100644 --- a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs +++ b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs @@ -12,7 +12,7 @@ namespace Testably.Server.Controllers; [AllowAnonymous] public class PullRequestStatusCheckController : ControllerBase { - private const string RepositoryOwner = "Testably"; + private const string[] RepositoryOwners = ["Testably", "aweXpect"]; private const string SuccessMessage = "The PR title must conform to the conventional commits guideline."; @@ -61,9 +61,9 @@ public async Task OnPullRequestChanged( } if (pullRequestModel.Repository.Private || - pullRequestModel.Repository.Owner.Login != RepositoryOwner) + RepositoryOwners.All(repositoryOwner => pullRequestModel.Repository.Owner.Login != repositoryOwner) { - return BadRequest($"Only public repositories from '{RepositoryOwner}' are supported!"); + return BadRequest($"Only public repositories from '{string.Join(", ", RepositoryOwners)}' are supported!"); } var bearerToken = _configuration.GetValue("GithubBearerToken"); @@ -159,4 +159,4 @@ private bool ValidateTitle(string title) return false; } -} \ No newline at end of file +} From 3afb517d4bb22c45ecbcdaedf493ba8905b0b9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Mon, 25 Nov 2024 08:29:32 +0100 Subject: [PATCH 2/3] Update PullRequestStatusCheckController.cs --- .../Controllers/PullRequestStatusCheckController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs index 033cc53..8c4a751 100644 --- a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs +++ b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs @@ -61,7 +61,7 @@ public async Task OnPullRequestChanged( } if (pullRequestModel.Repository.Private || - RepositoryOwners.All(repositoryOwner => pullRequestModel.Repository.Owner.Login != repositoryOwner) + RepositoryOwners.All(repositoryOwner => pullRequestModel.Repository.Owner.Login != repositoryOwner)) { return BadRequest($"Only public repositories from '{string.Join(", ", RepositoryOwners)}' are supported!"); } From 3fb6dc1540d015989270687f6bc5840513da7009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Breu=C3=9F?= Date: Mon, 25 Nov 2024 08:31:19 +0100 Subject: [PATCH 3/3] Update PullRequestStatusCheckController.cs --- .../Controllers/PullRequestStatusCheckController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs index 0744f16..a6dd661 100644 --- a/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs +++ b/Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs @@ -12,7 +12,7 @@ namespace Testably.Server.Controllers; [AllowAnonymous] public class PullRequestStatusCheckController : ControllerBase { - private const string[] RepositoryOwners = ["Testably", "aweXpect"]; + private static readonly string[] RepositoryOwners = ["Testably", "aweXpect"]; private const string SuccessMessage = "The PR title must conform to the conventional commits guideline.";