From cd6cdf6a6d776e93213a870354bbe5ef64be3abb Mon Sep 17 00:00:00 2001 From: Hannah Pho Date: Tue, 5 Nov 2024 14:21:04 -0500 Subject: [PATCH] head_ref = HEAD --- .github/workflows/all-commits-in-master.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/all-commits-in-master.yml b/.github/workflows/all-commits-in-master.yml index 63f050a496..0995a33df0 100644 --- a/.github/workflows/all-commits-in-master.yml +++ b/.github/workflows/all-commits-in-master.yml @@ -11,16 +11,16 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Fetch all history for accurate comparison + ref: ${{ github.head_ref }} # Check out the source branch - name: Check if commits exist in master run: | git remote add dc https://github.com/datacommonsorg/website.git git fetch dc MASTER_BRANCH="dc/master" - SOURCE_BRANCH=$(echo ${{ github.ref }}) # Get the list of commits in the source branch that are not in the master branch - MISSING_COMMITS=$(git log --pretty="%H - %s" $MASTER_BRANCH..$SOURCE_BRANCH --) + MISSING_COMMITS=$(git log --pretty="%H - %s" $MASTER_BRANCH..HEAD --) if [[ -n "$MISSING_COMMITS" ]]; then echo "ERROR: The following commits are not present in $MASTER_BRANCH:"