Skip to content

Add eslint and typescript checking 2 #2

Add eslint and typescript checking 2

Add eslint and typescript checking 2 #2

name: Check Base Branch Before Merge
on:
pull_request:
pull_request_review:
types: [submitted]
jobs:
check-base-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check base branch
run: |
git fetch origin
BASE_BRANCH=$(git rev-parse origin/${{ github.event.pull_request.base.ref }})
CURRENT_BRANCH=$(git rev-parse HEAD)
if [ "$BASE_BRANCH" != "$CURRENT_BRANCH" ]; then
echo "ERROR: The branch $BASE_BRANCH is not based off the latest version of the target branch $CURRENT_BRANCH."
exit 1
fi