Skip to content

Test new check again #7

Test new check again

Test new check again #7

name: all-commits-in-master
on:
pull_request:
branches: [ "customdc_stable" ]
jobs:
check_commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history for accurate comparison
- name: Check if commits exist in master
run: |
git remote add dc https://github.com/datacommonsorg/website.git
git fetch dc
MASTER_BRANCH="remotes/dc/master"
SOURCE_BRANCH=$(echo ${{ github.head_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 --)
if [[ -n "$MISSING_COMMITS" ]]; then
echo "ERROR: The following commits are not present in $MASTER_BRANCH:"
echo "$MISSING_COMMITS"
exit 1
fi
echo "All commits are present in $MASTER_BRANCH"