Skip to content

Commit

Permalink
Merge pull request #243 from simplybusiness/fix-status-message
Browse files Browse the repository at this point in the history
Refactor deploy status messages for clarity
  • Loading branch information
addersuk authored Nov 19, 2024
2 parents f157211 + 1db39fe commit a50f1a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/functionality/issue_deploy_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ def self.check_current_issue(config)
case config.event_payload['action']
when 'labeled'
github_summary_message += "### :boom: Deploys are blocked :boom:\n"
create_status_for_all_prs(config, 'failure', github_summary_message)
create_status_for_all_prs(config, 'failure', 'Deploys are blocked', github_summary_message)
when 'closed'
if SimplyIssue.get_all_issues(config, 'issues', 'block deploys').empty?
github_summary_message += "### :sparkles: You are free to deploy :sparkles:\n"
create_status_for_all_prs(config, 'success', github_summary_message)
create_status_for_all_prs(config, 'success', 'You are free to deploy', github_summary_message)
end
end
end

def self.create_status_for_all_prs(config, status, message)
def self.create_status_for_all_prs(config, status, status_message, message)
config.client.auto_paginate = true
all_pull_requests = SimplyIssue.get_all_issues(config, 'pull_request')
all_pull_requests.each do |pr|
result = config.client.create_status(
config.app_repo, pr['head']['sha'], status,
description: message,
description: status_message,
context: context_name,
target_url: config.event_payload['html_url']
)
Expand Down

0 comments on commit a50f1a3

Please sign in to comment.