Skip to content

Commit

Permalink
Added pull-request trigger to check on every PR creation, removed deb…
Browse files Browse the repository at this point in the history
…ug lines and removed the confetti emoji filtering
  • Loading branch information
Rd4dev committed Oct 3, 2024
1 parent fab6c2e commit afaf59e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Deploy to Wiki
on:
pull_request:
push:
branches:
- develop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ fun checkTableOfContents(file: File) {
it.contains(Regex("""##\s+Table\s+of\s+Contents""", RegexOption.IGNORE_CASE))
}
if (tocStartIdx == -1) {
println("No Table of Contents found for the file $file")
return
}

Expand All @@ -61,7 +60,6 @@ fun checkTableOfContents(file: File) {
if (eOfIdx == -1) error("Table of Contents didn't end with a blank line.")

val tocSpecificLines = fileContents.subList(tocStartIdx, tocStartIdx + eOfIdx + 1)
println("Toc line: $tocSpecificLines")

for (line in tocSpecificLines) {
if (line.trimStart().startsWith("- [") && !line.contains("https://")) {
Expand All @@ -85,7 +83,7 @@ fun validateTableOfContents(file: File, line: String) {
val linkRegex = "\\(#(.*?)\\)".toRegex()
val link = linkRegex.find(line)?.groupValues?.get(1)?.removePrefix("#")?.replace('-', ' ')
?.replace(Regex("[?&./:’'*!,(){}\\[\\]+]"), "")
?.replace("confetti_ball", "")?.trim()
?.trim()

// Checks if the table of content title matches with the header link text.
val matches = title.equals(link, ignoreCase = true)
Expand Down

0 comments on commit afaf59e

Please sign in to comment.