Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
chintankavathia committed Dec 2, 2024
1 parent 7d53f15 commit 72e02c5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Fetch all branches
- name: Attach to PR Branch
run: |
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
echo "Checked out branch: ${{ github.head_ref }}"
- name: Fetch Master Branch
run: |
git fetch --all
git fetch --verbose origin master || (echo "Git fetch failed"; exit 1)
- name: Check for divergence from master
- name: Check Rebase Status
run: |
git fetch origin master
UPSTREAM=master # Change this to `main` if applicable
UPSTREAM=master # Replace with `main` if needed
CURRENT=$(git rev-parse HEAD)
MERGED=$(git merge-base HEAD origin/$UPSTREAM)
Expand All @@ -34,12 +38,14 @@ jobs:
echo "MERGED commit hash: $MERGED"
if [ "$MERGED" != "$CURRENT" ]; then
echo "This branch is not rebased with the latest master."
echo "Branch is not rebased with $UPSTREAM."
echo "CURRENT: $CURRENT"
echo "MERGED: $MERGED"
echo "Rebase your branch onto the latest $UPSTREAM."
exit 1
else
echo "This branch is up-to-date with master."
echo "Branch is up-to-date with $UPSTREAM."
fi
build:
needs: check-rebase
runs-on: ubuntu-latest
Expand Down

0 comments on commit 72e02c5

Please sign in to comment.