VictoriaMetrics/.github/workflows/check-rebased.yml
Dima Lazerka 55b4436804
Add check-rebased Github action (#2002)
It will prevent merging in a branch that's not based on its base branch HEAD, leading to streamlined history.

Note it will not prevent squash commits, nor commits directly to base branch.
2022-01-03 16:57:10 +02:00

18 lines
556 B
YAML

name: check-rebased
on:
pull_request:
types: [ synchronize, opened, reopened, edited ] # +edited (for triggering on PR base change)
push:
branches: [ main ]
jobs:
hook:
name: Check whether current branch is based on its base branch
runs-on: ubuntu-latest
steps:
- name: Check out repo @ current branch
uses: actions/checkout@v2
with:
fetch-depth: 1000 # Hopefully current branch is less than 1000 commits from main
- name: Run check-rebased.sh
run: .github/workflows/check-rebased.sh