Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@

pull_request = args.head_ref and args.head_ref != args.base_ref

if not pull_request:
if pull_request:
# We check whether the PR is done from a branch that has the same name of
# the target branch in the ROOT repository using base_ref and head_ref:
# - The base_ref is e.g. "master" or "v6-38-00-patches"
# - The head_ref for PRs is formatted as <PR branch>:<Fork branch> e.g. "refs/pull/20742/head:cppyy_fixup"
if not ":" in args.head_ref:

Check failure on line 62 in .github/workflows/root-ci-config/build_root.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (E713)

.github/workflows/root-ci-config/build_root.py:62:16: E713 Test for membership should be `not in`
build_utils.print_error(f"This has been identified as a PR build. However, the head-ref is {args.head_ref}.")
branch_in_fork = args.head_ref.split(":")[-1]
if branch_in_fork == args.base_ref:
build_utils.print_error(f"The branch name in the fork and the base-ref are both called {branch_in_fork}. This is not supported. Please change the name of the branch in the forked repository.")
sys.exit(1)
else:
build_utils.print_info("head_ref same as base_ref, assuming non-PR build")

cleanup_previous_build()
Expand Down
Loading