Skip to content

Commit

Permalink
ci: add a workflow to check for duplicated entries
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanouil committed Apr 21, 2024
1 parent 4a055ec commit 564f43d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/check-duplicate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check Duplicate

on:
workflow_dispatch:
pull_request:

permissions:
pull-requests: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}
cancel-in-progress: true

jobs:
check-duplicate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for duplicates
shell: bash
run: |
FILE='extensions/quarto-extensions.csv'
COLUMN=2
duplicates=$(awk -F, -v col=$COLUMN '{print $col}' $FILE | sort | uniq -d)
if [[ -n "$duplicates" ]]; then
while read -r duplicate; do
grep -n "$duplicate" $FILE | while read -r line ; do
lineNumber=$(echo $line | cut -d: -f1)
echo "::error file=$FILE,line=$lineNumber,endLine=$lineNumber,title=Duplicate Entry::Duplicate value '$duplicate' found"
done
done <<< "$duplicates"
exit 1
fi
7 changes: 1 addition & 6 deletions extensions/quarto-extensions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,17 @@ formats,davidcarayon/quarto-inrae-extension
formats,fredguth/tufte-quarto
formats,wjschne/apaquarto
shortcodes-filters,shafayetShafee/code-fullscreen
shortcodes-filters,shafayetShafee/hide-comment
shortcodes-filters,leovan/quarto-pseudocode
shortcodes-filters,shafayetShafee/material-icons
shortcodes-filters,leovan/quarto-pseudocodematerial-icons
shortcodes-filters,dialoa/first-line-indent
shortcodes-filters,shafayetShafee/reveal-header

Check failure on line 121 in extensions/quarto-extensions.csv

View workflow job for this annotation

GitHub Actions / check-duplicate

Duplicate Entry

Duplicate value 'shafayetShafee/reveal-header' found
shortcodes-filters,shafayetShafee/black-formatter
shortcodes-filters,dialoa/recursive-citeproc
shortcodes-filters,ute/search-replace
shortcodes-filters,shafayetShafee/interactive-sql
shortcodes-filters,ttalVlatt/Quarto-Docx-Horizontal-Rule
shortcodes-filters,clearmatics/qreacto
shortcodes-filters,data-intuitive/quarto-d2
shortcodes-filters,kdheepak/quarto-svgbob
shortcodes-filters,andrewheiss/quarto-wordcount
formats,coatless/quarto-illinois
formats,grantmcdermott/quarto-revealjs-clean
shortcodes-filters,produnis/quarto-timer
shortcodes-filters,dragonstyle/share-post
shortcodes-filters,bcdavasconcelos/citetools
Expand Down

0 comments on commit 564f43d

Please sign in to comment.