public virtual async Task PutCommitStatus(PutCommitStatusRequest request) { if (request.ServiceName == null || request.EnvironmentName == null || request.GithubOwner == null || request.GithubRepo == null || request.GithubRef == null) { return; } var encryptedGithubToken = Environment.GetEnvironmentVariable("GITHUB_TOKEN"); var commitStatusClient = await commitStatusClientFactory.Create(encryptedGithubToken); await commitStatusClient.Create(request.GithubOwner, request.GithubRepo, request.GithubRef, new NewCommitStatus { State = request.CommitState, TargetUrl = GetSsoUrl(request), Description = $"{request.ServiceName} Deployment {GetStatusDescription(request.CommitState)}", Context = $"{request.ServiceName} - {request.EnvironmentName} ({request.ProjectName})" }); }
private static string GetSsoUrl(PutCommitStatusRequest request) { var destination = Uri.EscapeUriString(request.DetailsUrl); return($"https://sso.brigh.id/start/{request.EnvironmentName.ToLower()}?destination={destination}"); }