lib/ruboty/github/actions/merge_pull_request.rb in ruboty-qiita-github-0.3.2 vs lib/ruboty/github/actions/merge_pull_request.rb in ruboty-qiita-github-0.3.3
- old
+ new
@@ -6,14 +6,25 @@
class MergePullRequest < CloseIssue
private
def close
request
- message.reply("Merged #{issue.html_url}")
+ after_merge_message
end
def request
client.merge_pull_request(repository, issue_number)
+ end
+
+ def after_merge_message
+ message.reply("Merged #{issue.html_url}")
+
+ custom_message = ENV.fetch('AFTER_MERGE_MESSAGE', nil)
+ target_repository = ENV.fetch('AFTER_MERGE_MESSAGE_TARGET_REPOSITORY', '')
+
+ return unless (repository == target_repository) && custom_message
+
+ message.reply(custom_message)
end
end
end
end
end