diff --git a/.gitea/workflows/unicode_check.yaml b/.gitea/workflows/unicode_check.yaml new file mode 100644 index 0000000..7c2db75 --- /dev/null +++ b/.gitea/workflows/unicode_check.yaml @@ -0,0 +1,22 @@ +--- +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 + with: + submodules: false + + - name: Check for disallowed chars + run: | + set -x + modifiche=$(git diff --unified=0 ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep -E "^[+]" | grep -Ev '^(--- a/|\+\+\+ b/)') + num=$(echo $modifiche | grep -c -e '[\u2014]' -e '[\u2018]' -e '[\u2019]' -e '[\u201C]' -e '[\u201D]' -e '[\u2026]' ) + if [ $num -gt 0 ] ; then exit 1 ; done