debian-mirror-gitlab/danger/ci_templates/Dangerfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
1.1 KiB
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
2023-03-17 16:20:25 +05:30
CI_CD_TEMPLATE_MESSAGE = <<~MSG
2021-01-03 14:25:43 +05:30
This merge request requires a CI/CD Template review. To make sure these
changes are reviewed, take the following steps:
1. Ensure the merge request has the ~"ci::templates" label.
If the merge request modifies CI/CD Template files, Danger will do this for you.
1. Prepare your MR for a CI/CD Template review according to the
[template development guide](https://docs.gitlab.com/ee/development/cicd/templates.html).
1. Assign and `@` mention the CI/CD Template reviewer suggested by Reviewer Roulette.
MSG
2023-03-17 16:20:25 +05:30
CI_CD_TEMPLATE_FILES_MESSAGE = <<~MSG
2021-01-03 14:25:43 +05:30
The following files require a review from the CI/CD Templates maintainers:
MSG
2021-04-17 20:07:23 +05:30
return unless helper.ci?
2021-01-03 14:25:43 +05:30
2022-01-26 12:08:38 +05:30
template_paths_to_review = helper.changes_by_category[:ci_template]
2021-01-03 14:25:43 +05:30
2022-06-21 17:19:12 +05:30
if helper.mr_labels.include?('ci::templates') || template_paths_to_review.any?
2023-03-17 16:20:25 +05:30
message('This merge request adds or changes files that require a ' \
'review from the CI/CD Templates maintainers.')
2021-01-03 14:25:43 +05:30
2023-03-17 16:20:25 +05:30
markdown(CI_CD_TEMPLATE_MESSAGE)
if template_paths_to_review.any?
markdown(CI_CD_TEMPLATE_FILES_MESSAGE + helper.markdown_list(template_paths_to_review))
end
2021-01-03 14:25:43 +05:30
end