Skip to content

Commit

Permalink
head_ref = HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
hqpho committed Nov 5, 2024
1 parent eba8ea7 commit cd6cdf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/all-commits-in-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand Down

0 comments on commit cd6cdf6

Please sign in to comment.