diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e824eeee2..534012ee3 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -84,6 +84,14 @@ jobs: echo "$file was changed" done + - name: Check if the source and target branches are different + if: ${{ github.event.pull_request.base.ref == github.event.pull_request.head.ref }} + run: | + echo "Source Branch ${{ github.event.pull_request.head.ref }}" + echo "Target Branch ${{ github.event.pull_request.base.ref }}" + echo "Error: Source and Target Branches are the same. Please ensure they are different." + exit 1 + # - name: Echo the GitHub environment for troubleshooting # run: echo "$GITHUB_CONTEXT" # - name: Echo the GitHub context for troubleshooting