Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to check for duplicated entries #15

Merged
merged 5 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 | tail -n +2 | 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

8 changes: 1 addition & 7 deletions extensions/quarto-extensions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,16 @@ 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
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