Skip to content

Commit

Permalink
Merge pull request #237 from simplybusiness/github-summary
Browse files Browse the repository at this point in the history
Refactor create_github_summary markdown
  • Loading branch information
LightningStairs authored Oct 29, 2024
2 parents 32dac3d + 68e0db5 commit e14394f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
12 changes: 2 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-10-28 16:35:08 UTC using RuboCop version 1.66.1.
# on 2024-10-29 16:58:26 UTC using RuboCop version 1.66.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -28,17 +28,9 @@ Metrics/MethodLength:
- 'spec/**/*.rb'
- 'lib/functionality/base_deploy_check.rb'

# Offense count: 11
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantStringEscape:
Exclude:
- 'lib/functionality/base_deploy_check.rb'
- 'lib/functionality/issue_deploy_check.rb'
- 'lib/functionality/pr_deploy_check.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 146
Max: 151
4 changes: 2 additions & 2 deletions lib/functionality/base_deploy_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def self.base_check(config, event, sha)
target_url: config.event_payload['html_url']
)
end
github_summary_message += "Created #{result[:state]} state with description: #{result[:description]}"
github_summary_message += "for sha #{sha} and url #{result[:url]}\n"
github_summary_message += "- Created #{result[:state]} state with description: #{result[:description]}\n"
github_summary_message += "- for sha #{sha} and url #{result[:url]}\n"
github_summary_message += '========================================================================='
create_github_summary(github_summary_message)
puts "Created #{result[:state]} state with description #{result[:description]}"
Expand Down
6 changes: 3 additions & 3 deletions lib/functionality/issue_deploy_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def self.create_status_for_all_prs(config, status, message)
context: context_name,
target_url: config.event_payload['html_url']
)
message += "Created #{result[:state]} state with\n"
message += "description #{result[:description]} for PR #{pr.number} and url #{result[:url]}\n"
message += "with target_url #{config.event_payload['html_url']}\n"
message += "- Created #{result[:state]} state with\n"
message += "- description #{result[:description]} for PR #{pr.number} and url #{result[:url]}\n"
message += "- with target_url #{config.event_payload['html_url']}\n"
message += '============================================================================================ \ '
create_github_summary(message)
puts "Created #{result[:state]} state with " \
Expand Down
10 changes: 5 additions & 5 deletions lib/functionality/pr_deploy_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def self.check_labeled_pr(config)
context: context_name,
target_url: config.event_payload['html_url']
)
github_summary_message = "Deploy Status Check\n"
github_summary_message = "## Deploy Status Check\n"
github_summary_message += "### :sparkles: You are free to deploy :sparkles:\n"
github_summary_message += " Created #{result[:state]} state with description #{result[:description]} for sha #{sha} and url #{result[:url]}\n"
github_summary_message += " description #{result[:description]} for sha #{sha} for url #{result[:url]}\n"
github_summary_message += " with target_url #{config.event_payload['html_url']}\n "
github_summary_message += ' ============================================================================================'
github_summary_message += "- Created #{result[:state]} state with description #{result[:description]} for sha #{sha} and url #{result[:url]}\n"
github_summary_message += "- description #{result[:description]} for sha #{sha} for url #{result[:url]}\n"
github_summary_message += "- with target_url #{config.event_payload['html_url']}\n "
github_summary_message += '============================================================================================'
create_github_summary(github_summary_message)

puts "Created #{result[:state]} state with" \
Expand Down

0 comments on commit e14394f

Please sign in to comment.