Add eslint and typescript checking 2 #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |