Skip to content

Commit

Permalink
add workflow to validate redirects.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
rushatgabhane committed Apr 17, 2024
1 parent 171b0f3 commit 5363920
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/verifyRedirect.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# HelpDot - Verifies that redirects.csv does not have any duplicates
# Duplicate sourceURLs break redirection on cloudflare pages

duplicates=$(awk -F, 'a[$1]++{print "duplicate redirects are not allowed: " $1}' ../../docs/redirects.csv)

if [[ -z "$duplicates" ]]; then
exit 0
fi

echo $duplicates
exit 1

0 comments on commit 5363920

Please sign in to comment.