summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2019-07-01 10:52:23 +0200
committerAchilleas Pipinellis <axil@gitlab.com>2019-07-01 11:10:34 +0200
commit4cfed54c7616aeb45255f0e87a5fe221417d339e (patch)
treec9754e8e8bf3a70c52d9a79b76a82de8fd2f8fac
parent8775e4a1faf13a01451e71ea9ef729dc52e6d3c1 (diff)
downloadgitlab-ce-docs/exclude-docs-yaml-from-danger.tar.gz
Exclude docs.gitlab-ci.yml when checking for docs-only branchesdocs/exclude-docs-yaml-from-danger
For docs-only branches, we should be allowed to change docs.gitlab-ci.yml if that's the only non-doc file.
-rw-r--r--danger/only_documentation/Dangerfile3
1 files changed, 2 insertions, 1 deletions
diff --git a/danger/only_documentation/Dangerfile b/danger/only_documentation/Dangerfile
index 8e4564f22b6..5126cd36596 100644
--- a/danger/only_documentation/Dangerfile
+++ b/danger/only_documentation/Dangerfile
@@ -2,9 +2,10 @@
# frozen_string_literal: true
has_only_docs_changes = helper.all_changed_files.all? { |file| file.start_with?('doc/') }
+has_only_docs_ci_yaml = helper.all_changed_files.all? { |file| file.start_with?('.gitlab/ci/docs.gitlab-ci.yml') }
is_docs_only_branch = gitlab.branch_for_head =~ /(^docs[\/-].*|.*-docs$)/
-if is_docs_only_branch && !has_only_docs_changes
+if is_docs_only_branch && !has_only_docs_changes && !has_only_docs_ci_yaml
fail "It seems like your branch name has a `docs` prefix or suffix. "\
"The CI won't run the full pipeline, but you also have changed non-docs files. "\
"Please recreate this MR with a new branch name."