bglug.it/.gitea/workflows/unicode_check.yaml

28 lines
959 B
YAML
Raw Normal View History

2024-08-04 08:27:38 +00:00
---
name: Check for disallowed chars
on:
pull_request:
jobs:
unicode-check:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
2024-08-04 10:58:52 +00:00
with:
2024-08-04 11:25:48 +00:00
fetch-depth: 0
2024-08-04 08:27:38 +00:00
- name: Check for disallowed chars
2024-08-04 16:23:32 +00:00
shell: bash
2024-08-04 08:27:38 +00:00
run: |
2024-08-04 16:19:23 +00:00
set -x
2024-08-04 08:27:38 +00:00
modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)')
2024-08-05 19:06:16 +00:00
num=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} content/ | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)' | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' )
2024-08-04 16:19:23 +00:00
2024-08-04 11:38:39 +00:00
echo "modifiche: $modifiche"
echo "num: $num"
2024-08-04 16:23:32 +00:00
exit 0
if [ $num -gt 0 ] ; then exit 1 ; else echo "ok" ; done