From f4c6e1174c8ece4de32fcee3ab7ccb267b640ea7 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Sat, 12 Oct 2024 06:03:46 +0800 Subject: [PATCH] ci/request-reviews: fix headRef to point to the PR head Previously, headRef points to the master branch of Nixpkgs, which basically means no code owner review will be requested. The problem can be verified using the following command. $ DRY_MODE=1 ./ci/request-reviews/request-reviews.sh NixOS/nixpkgs 347973 ci/OWNERS [...] This PR touches 0 files Requesting reviews from: { "reviewers": [] } [...] Additionally, the comment about conflicts is removed thanks to the unambiguous way of specifying ref. --- ci/request-reviews/request-reviews.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/request-reviews/request-reviews.sh b/ci/request-reviews/request-reviews.sh index 8a3d78a50d5f..b21354560242 100755 --- a/ci/request-reviews/request-reviews.sh +++ b/ci/request-reviews/request-reviews.sh @@ -60,9 +60,8 @@ git -C "$tmp/nixpkgs.git" remote add fork https://github.com/"$prRepo".git git -C "$tmp/nixpkgs.git" config remote.fork.partialclonefilter tree:0 git -C "$tmp/nixpkgs.git" config remote.fork.promisor true -# Our local branches mirror Nixpkgs, so make sure to not try to update any to avoid conflicts git -C "$tmp/nixpkgs.git" fetch --no-tags fork "$prBranch" -headRef=$(git -C "$tmp/nixpkgs.git" rev-parse HEAD) +headRef=$(git -C "$tmp/nixpkgs.git" rev-parse refs/remotes/fork/"$prBranch") log "Checking correctness of the base branch" if ! "$SCRIPT_DIR"/verify-base-branch.sh "$tmp/nixpkgs.git" "$headRef" "$baseRepo" "$baseBranch" "$prRepo" "$prBranch" | tee "$tmp/invalid-base-error" >&2; then