private static bool PublishSlack(string buildVersion, string releaseHistoryMarkdown) { if (!_programArgs.PublishToSlack) { return(true); } return(SlackPublisher.PublishPost(buildVersion, releaseHistoryMarkdown, _programArgs)); }
private static int PublishSlack(string buildVersion, string releaseHistoryMarkdown, int exitCode) { if (!_programArgs.PublishToSlack) { return(exitCode); } if (SlackPublisher.PublishPost(buildVersion, releaseHistoryMarkdown, _programArgs)) { exitCode = SuccessExitCode; } else { exitCode = FailureExitCode; } return(exitCode); }
public static void ExecuteOn_Publishing_Through_SendMessage(XComponent.SlackProxy.UserObject.SendMessage sendMessage, XComponent.SlackProxy.UserObject.PublishMessage publishMessage, object object_InternalMember, Context context, ISendMessageSendMessageOnPublishingPublishMessageSenderInterface sender) { try { SlackPublisher slackPublisher = new SlackPublisher(); slackPublisher.UrlWithToken = sendMessage.SlackUrlWithToken; slackPublisher.Channel = sendMessage.SlackChannel; slackPublisher.SlackUser = sendMessage.SlackUser; if (!string.IsNullOrEmpty(sendMessage.Color)) { slackPublisher.Color = sendMessage.Color; } if (!string.IsNullOrEmpty(sendMessage.Text)) { slackPublisher.Text = sendMessage.Text; } if (!string.IsNullOrEmpty(sendMessage.IconEmoji)) { slackPublisher.IconEmoji = sendMessage.IconEmoji; } if (!string.IsNullOrEmpty(sendMessage.MessageImage)) { slackPublisher.MessageImage = sendMessage.MessageImage; } if (!string.IsNullOrEmpty(sendMessage.MessageTitle)) { slackPublisher.MessageTitle = sendMessage.MessageTitle; } slackPublisher.SendMessage(); sender.Success(context); } catch (Exception ex) { publishMessage.Message = ex.ToString(); sender.Error(context); } }
public HomeController(SlackPublisher slackPublisher, ILogger <HomeController> logger) { _slackPublisher = slackPublisher; _logger = logger; }