You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2c5891e
Browse filesBrowse the repository at this point in the historyBrowse files
fix: hardcode main/master to always build (per review by @Mpdreamz)
Many repos keep legacy AsciiDoc docs on their default branch via the
do-not-delete_legacy-docs pattern in conf.yaml, so skip-build detection
is too risky to trust there. Bypassing legacy_branches.pl for main/master
also means the check no longer depends on the perl YAML module.
echo"Target branch '${GITHUB_PR_TARGET_BRANCH}' has no legacy AsciiDoc docs in conf.yaml for ${GITHUB_PR_BASE_REPO} — skipping build (reporting success)."
53
-
exit 0
44
+
# main/master are hardcoded to always build, skipping the conf.yaml check below entirely:
45
+
# many repos keep legacy AsciiDoc docs on their default branch via the
46
+
# do-not-delete_legacy-docs pattern in conf.yaml, so this is the one case too risky to get
47
+
# wrong, and hardcoding it means it works even when the perl YAML dep is missing.
48
+
if [[ "${GITHUB_PR_TARGET_BRANCH}"!="main"&&"${GITHUB_PR_TARGET_BRANCH}"!="master" ]];then
49
+
# Skip the build but report success when the PR targets a branch that no longer carries
50
+
# legacy AsciiDoc docs (per conf.yaml). docs-build-pr is a required check, so we exit 0
51
+
# to keep it green rather than failing or leaving it pending.
52
+
# The helper exits non-zero on a parse error or unknown repo, which short-circuits the
53
+
# condition below so we build as today — i.e. fail open, never block a real build.
54
+
if legacy_branches=$(perl "$(dirname "$0")/legacy_branches.pl""$GITHUB_PR_BASE_REPO") \
echo"Target branch '${GITHUB_PR_TARGET_BRANCH}' has no legacy AsciiDoc docs in conf.yaml for ${GITHUB_PR_BASE_REPO} — skipping build (reporting success)."
58
+
exit 0
59
+
fi
54
60
fi
55
61
56
62
# Buildkite PR bot for repositories other than the `elastic/docs` repo are configured to
0 commit comments