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 e29882d commit 84aa6e4
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,47 @@ 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 all branches
- name: Attach to PR Branch
run: |
git fetch --all
echo "Checking out the PR branch: ${{ github.head_ref }}"
git checkout ${{ github.head_ref }}
echo "Checked out branch: ${{ github.head_ref }}"
- name: Check for divergence from master
- name: Fetch the latest upstream master (or main) branch
run: |
git fetch origin master
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: Verify PR and Upstream master State
run: |
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 $UPSTREAM."
echo "Run 'git rebase upstream/$UPSTREAM' locally to fix this."
exit 1
else
echo "Branch is up-to-date with $UPSTREAM."
fi
build:
needs: check-rebase
Expand Down

0 comments on commit 84aa6e4

Please sign in to comment.