]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
pr_only_for: Default to ceph/ceph, check GH for target branch
authorDavid Galloway <david.galloway@ibm.com>
Mon, 15 Jun 2026 19:51:32 +0000 (15:51 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Tue, 16 Jun 2026 14:18:57 +0000 (10:18 -0400)
In case we manually triggered the job.

Signed-off-by: David Galloway <david.galloway@ibm.com>
scripts/build_utils.sh

index a13a442b5c3d16a61d73d50300fef729ea866002..907dc6ab840d7bbeaa64f28b99676ec5e41243c5 100755 (executable)
@@ -1629,6 +1629,13 @@ pr_only_for() {
   # receive by creating another local array ("$@")
   local -n local_patterns=$1
   local files
+  # Manually-triggered jobs don't get the ghprb* variables set by the GitHub
+  # Pull Request Builder plugin.  Assume ceph/ceph and look up the PR's target
+  # branch from the GitHub API.
+  if [ "$BUILD_CAUSE" = "MANUALTRIGGER" ]; then
+    ghprbGhRepository="ceph/ceph"
+    ghprbTargetBranch="$(curl -s -u ${GITHUB_USER}:${GITHUB_PASS} https://api.github.com/repos/${ghprbGhRepository}/pulls/${ghprbPullId} | jq -r '.base.ref')"
+  fi
   pushd .
   # cd to ceph repo if we need to.
   # The ceph-pr-commits job checks out ceph.git and ceph-build.git but most