Commit c4e088c8 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'danger-docs-only-no-changelog' into 'master'

Disable changelog check on docs-only MRs

Closes #37340

See merge request gitlab-org/gitlab!20729
parents 71c398d0 a4791192
......@@ -29,6 +29,10 @@ def ce_port_changelog?(changelog_path)
helper.ee? && !ee_changelog?(changelog_path)
end
def docs_only_change?
helper.changes_by_category.keys == [:docs]
end
def check_changelog(path)
yaml = YAML.safe_load(File.read(path))
......@@ -55,7 +59,7 @@ def sanitized_mr_title
gitlab.mr_json["title"].gsub(/^WIP: */, '').gsub(/`/, '\\\`')
end
changelog_needed = (gitlab.mr_labels & NO_CHANGELOG_LABELS).empty?
changelog_needed = !docs_only_change? && (gitlab.mr_labels & NO_CHANGELOG_LABELS).empty?
changelog_found = git.added_files.find { |path| path =~ %r{\A(ee/)?(changelogs/unreleased)(-ee)?/} }
if git.modified_files.include?("CHANGELOG.md")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment