From 190e9464ce5db59e30ff21fdfff4d3f2f5a4a380 Mon Sep 17 00:00:00 2001 From: Sean OMeara Date: Tue, 28 Sep 2021 17:15:44 +0200 Subject: [PATCH] adding commit message linter --- .github/workflows/badstrings.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/badstrings.yml diff --git a/.github/workflows/badstrings.yml b/.github/workflows/badstrings.yml new file mode 100644 index 000000000..cb8e96690 --- /dev/null +++ b/.github/workflows/badstrings.yml @@ -0,0 +1,17 @@ +name: badstrings +on: [pull_request, push] +jobs: + badstrings: + runs-on: ubuntu-latest + steps: + - name: scanning commit message for bad strings + run: | + #!/bin/bash + set -euo pipefail + IFS=$'\n\t' + message="${{ github.event.head_commit.message }}" + + strings=($(curl -s https://raw.githubusercontent.com/someara/badstrings/main/strings.txt)) + for i in ${strings[@]} ; do + echo "${message}" | grep -v "$i" &>/dev/null; + done