Files
specs/.gitea/workflows/verify.yml
T
ksv741 45e871c0f2
Specs security / security (pull_request) Canceled after 0s
Specs verify / verify (pull_request) Canceled after 0s
Conventional commits / commits (pull_request) Canceled after 9s
ci: check whitespace in committed PR/push range (WealthLedger/specs#2)
2026-11-02 20:28:20 +03:00

37 lines
1.2 KiB
YAML

name: Specs verify
on:
push:
branches: [develop, main]
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: specs-verify-${{ gitea.event_name }}-${{ gitea.event.pull_request.number || gitea.ref }}
cancel-in-progress: true
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v4
with:
fetch-depth: 0
- name: Check whitespace in committed range
env:
PR_BASE: ${{ github.event.pull_request.base.sha }}
PR_HEAD: ${{ github.event.pull_request.head.sha }}
PUSH_BEFORE: ${{ github.event.before }}
PUSH_AFTER: ${{ github.sha }}
run: |
if [ -n "$PR_HEAD" ]; then
range="$PR_BASE...$PR_HEAD"
elif [ -n "$PUSH_BEFORE" ] && ! expr "$PUSH_BEFORE" : '0*$' >/dev/null; then
range="$PUSH_BEFORE..$PUSH_AFTER"
else
# New branch / unknown before: only the pushed commit; full tree would hit read-only archives.
range="$PUSH_AFTER^..$PUSH_AFTER"
fi
echo "Checked revision: $(git rev-parse HEAD); range: $range"
git diff --check "$range"