Skip to content

Add eslint and typescript checking 2 #14

Add eslint and typescript checking 2

Add eslint and typescript checking 2 #14

name: Check Base Branch
on:
pull_request:
pull_request_review:
types: [submitted]
jobs:
check-base-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check base branch
run: |
git fetch origin
TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
CURRENT_BRANCH="${{ github.event.pull_request.head.ref }}"
COMMITS_BEHIND=$(git log --oneline origin/$TARGET_BRANCH origin/$CURRENT_BRANCH)
if [ -n "$COMMITS_BEHIND" ]; then
echo "Your branch is behind the target branch. The following commits are missing:"
echo "$COMMITS_BEHIND"
exit 1
else
echo "Your branch is up to date with the target branch."
fi