Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Revert "test"

This reverts commit 7a9f7f4.

test

test

test
  • Loading branch information
chintankavathia committed Dec 2, 2024
1 parent 00889a1 commit 823c9ae
Showing 1 changed file with 38 additions and 9 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,52 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full history is fetched

- name: Add upstream remote
run: |
# Add the upstream repository (base repo)
echo "Adding upstream remote..."
git remote add upstream https://github.com/siemens/ngx-datatable.git
git fetch upstream
echo "Upstream remote added and fetched."
- name: Fetch PR Branch from Fork
run: |
echo "Fetching PR branch from fork..."
git fetch origin ${{ github.head_ref }}:refs/remotes/origin/${{ github.head_ref }}
echo "Fetched PR branch: ${{ github.head_ref }}"
- name: Attach to PR Branch
run: |
echo "Checking out the PR branch: ${{ github.head_ref }}"
git checkout ${{ github.head_ref }}
echo "Checked out branch: ${{ github.head_ref }}"
- name: Fetch all branches
- name: Fetch the latest upstream master (or main) branch
run: |
git fetch --all
echo "Fetching latest master from upstream..."
git fetch upstream master # or main if that's your default branch
echo "Fetched latest master branch from upstream."
- name: Check for divergence from master
- name: Verify PR and Upstream master State
run: |
git fetch origin master
UPSTREAM=${{ github.base_ref }} # Target branch of the pull request (usually master)
CURRENT=$(git rev-parse HEAD) # Latest commit on the PR branch
MERGED=$(git merge-base HEAD origin/$UPSTREAM) # Common ancestor between HEAD and master
UPSTREAM=master # Use 'main' if your default branch is named 'main'
echo "Target upstream branch: $UPSTREAM"
CURRENT=$(git rev-parse HEAD)
MERGED=$(git merge-base HEAD upstream/$UPSTREAM)
echo "Current commit hash: $CURRENT"
echo "Merged commit hash: $MERGED"
# Check if the branch is rebased or not
if [ "$MERGED" != "$CURRENT" ]; then
echo "This branch is not rebased with the latest master."
echo "This branch is not rebased with the latest $UPSTREAM."
echo "Run 'git rebase upstream/$UPSTREAM' locally to fix this."
exit 1
else
echo "This branch is up-to-date with master."
echo "Branch is up-to-date with $UPSTREAM."
fi
build:
Expand Down

0 comments on commit 823c9ae

Please sign in to comment.