diff --git a/.github/workflows/mirror_noir_subrepo.yml b/.github/workflows/mirror_noir_subrepo.yml index 27c1dd168f0d..9dc20b3cdb1e 100644 --- a/.github/workflows/mirror_noir_subrepo.yml +++ b/.github/workflows/mirror_noir_subrepo.yml @@ -60,12 +60,15 @@ jobs: # Reset our branch to our expected target git push origin $BRANCH --force cd .. - # Get the last merged PR + # Get the last sync PR's last commit state LAST_MERGED_PR_HASH=`gh pr list --repo=noir-lang/noir --state merged --head aztec-packages --json headRefOid --jq=.[0].headRefOid` + # Use a commit heuristic where we look at when .gitrepo first started to look at that commit state (through a push) COMMIT_HEURISTIC=$(git log -p -S"$LAST_MERGED_PR_HASH" --reverse --source -- noir/.gitrepo | grep -m 1 '^commit' | awk '{print $2}' || true) if [[ " $COMMIT_HEURISTIC" = "" ]] ; then + # It it fails, just use our gitrepo parent commit (last time we pushed or pulled) COMMIT_HEURISTIC=$BASE_AZTEC_COMMIT fi + # Create a filtered git log for release-please changelog / metadata MESSAGE=$(git log --pretty=format:"%s" $COMMIT_HEURISTIC..HEAD -- noir/ ':!noir/.gitrepo' | grep -v 'git subrepo' || true) # Fix Aztec PR links MESSAGE=$(echo "$MESSAGE" | sed -E 's/\(#([0-9]+)\)/(https:\/\/github.com\/AztecProtocol\/aztec-packages\/pull\/\1)/g')