Skip to content

Commit

Permalink
Add a GitHub workflow that verifies all commits are already in master (
Browse files Browse the repository at this point in the history
…#4708)

This will be used to make sure no commits get merged into
customdc_stable that aren't already in master.
  • Loading branch information
hqpho authored Nov 5, 2024
1 parent f1ae34e commit 55eed44
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/all-commits-in-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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: |
MASTER_BRANCH="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"

0 comments on commit 55eed44

Please sign in to comment.