summaryrefslogtreecommitdiff
path: root/danger/documentation/Dangerfile
blob: dc43e9d18431140dc9573625555824777004a7dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

def gitlab_danger
  @gitlab_danger ||= GitlabDanger.new(helper.gitlab_helper)
end

docs_paths_to_review = helper.changes_by_category[:docs]

return if docs_paths_to_review.empty?

message 'This merge request adds or changes documentation files. A review from the Technical Writing team before you merge is **recommended**. Reviews can happen after you merge.'

return unless gitlab_danger.ci?

markdown(<<~MARKDOWN)
  ## Documentation review

  The following files require a review from a technical writer:

  * #{docs_paths_to_review.map { |path| "`#{path}`" }.join("\n* ")}

  The review does not need to block merging this merge request. See the:

  - [Technical Writers assignments](https://about.gitlab.com/handbook/engineering/technical-writing/#designated-technical-writers) for the appropriate technical writer for this review.
  - [Documentation workflows](https://docs.gitlab.com/ee/development/documentation/workflow.html) for information on when to assign a merge request for review.
MARKDOWN