Skip to content

Add github action to check if your branch is up to date #1

Add github action to check if your branch is up to date

Add github action to check if your branch is up to date #1

Workflow file for this run

name: check-pr-merge
on:
push:
branches:
- '**'
- '!master'
jobs:
check-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if branch is up to date
run: |
res=$(git --no-pager log HEAD..origin/master --oneline)
if [[ -z "$res" ]]; then
echo "Branch is up to date with master"
else
echo "Branch is not up to date with master"
echo "Please rebase your branch"
exit 1
fi