Skip to content

Commit

Permalink
Update deploy status handling to include summary messages
Browse files Browse the repository at this point in the history
  • Loading branch information
addersuk committed Nov 19, 2024
1 parent 8dcd72b commit 1db39fe
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', 'Deploys are blocked')
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', 'You are free to deploy')
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 1db39fe

Please sign in to comment.