Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[AllowAnonymous]
public class PullRequestStatusCheckController : ControllerBase
{
private const string RepositoryOwner = "Testably";
private static readonly string[] RepositoryOwners = ["Testably", "aweXpect"];

private const string SuccessMessage =
"The PR title must conform to the conventional commits guideline.";
Expand Down Expand Up @@ -62,15 +62,15 @@
}

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<string>("GithubBearerToken");
using var client = _clientFactory.CreateClient("Proxied");
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("Testably",
Assembly.GetExecutingAssembly().GetName().Version.ToString()));

Check warning on line 73 in Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 73 in Source/Testably.Server/Controllers/PullRequestStatusCheckController.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", bearerToken);

Expand Down