Skip to content

Commit

Permalink
Merge pull request community#148825 from community/resolve-exit-early
Browse files Browse the repository at this point in the history
Update resolve_incident_discussion.rb to exit early
  • Loading branch information
alidacodes authored Jan 9, 2025
2 parents c79b600 + 1116cc1 commit afbc215
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/actions/resolve_incident_discussion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# first, we must identify the correct incident to update, in the case where there are multiple open incident discussions.
discussion = Discussion.find_open_incident_discussions(owner: "community", repo: "community").keep_if { |d| d.body.include?("#{ENV["INCIDENT_SLUG"]}") }.first

if discussion.nil?
puts "No applicable discussion, exiting"
exit
end

discussion.add_comment(body: "### Incident Resolved \n This incident has been resolved.")
# update the post body to include the resolved picture
updated_body = "![A dark background with two security-themed abstract shapes positioned in the top left and bottom right corners. In the center of the image, bold white text reads \\\"Incident Resolved\\\" with a white Octocat logo.](https://github.com/community/community/blob/main/.github/src/incident_resolved.png?raw=true) \n \n #{discussion.body}"
Expand Down

0 comments on commit afbc215

Please sign in to comment.