From 2491c2b7723c17195ee9ae70dc200cd219c1711b Mon Sep 17 00:00:00 2001 From: Esteban Martinena Guerrero Date: Sun, 9 Apr 2023 10:15:50 +0200 Subject: [PATCH 1/2] uniq workflow --- .github/workflows/uniq.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/uniq.yaml diff --git a/.github/workflows/uniq.yaml b/.github/workflows/uniq.yaml new file mode 100644 index 000000000..cff2a12fd --- /dev/null +++ b/.github/workflows/uniq.yaml @@ -0,0 +1,20 @@ +name: Check uniq keys + +on: + push: + paths: + - 'client/dictionaries/**' + pull_request: + paths: + - 'client/dictionaries/**' + workflow_dispatch: + + +jobs: + check-unique: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: | + find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " + if [[ $(find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " | grep -v "./" | wc -l) -gt 0 ]]; then exit 1; fi From a1e8161aff03ef7fe1e8a1036ed5470493a7727e Mon Sep 17 00:00:00 2001 From: Esteban Martinena Guerrero Date: Sun, 9 Apr 2023 10:17:15 +0200 Subject: [PATCH 2/2] fix --- .github/workflows/uniq.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/uniq.yaml b/.github/workflows/uniq.yaml index cff2a12fd..2c56c5bbf 100644 --- a/.github/workflows/uniq.yaml +++ b/.github/workflows/uniq.yaml @@ -15,6 +15,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " - if [[ $(find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " | grep -v "./" | wc -l) -gt 0 ]]; then exit 1; fi + - name: check unique keys in dic filesç + shell: bash + run: | + find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " + if [[ $(find . -type f -name "*.dic" | xargs -I {} sh -c "echo {} && cat {} | grep -v '#' | sort | uniq -i -d -c | sort -n -r " | grep -v "./" | wc -l) -gt 0 ]]; then exit 1; fi +