chore: add check development commit runner
This commit is contained in:
parent
5534a0b1b3
commit
da90ff3cfd
1 changed files with 22 additions and 0 deletions
22
.forgejo/workflows/check-development-commit.yml
Normal file
22
.forgejo/workflows/check-development-commit.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
name: Check Squash Development
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Verificar quantidade de commits
|
||||||
|
run: |
|
||||||
|
# Conta quantos commits existem na branch do PR em relação à base
|
||||||
|
COUNT=$(git rev-list --count HEAD ^origin/development)
|
||||||
|
if [ "$COUNT" -gt 1 ]; then
|
||||||
|
echo "Atenção: O PR contém $COUNT commits. Por favor, faça squash para manter 1 único commit."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "Histórico limpo! 1 commit detectado."
|
||||||
|
fi
|
||||||
Loading…
Reference in a new issue