Skip to content

Commit

Permalink
Fix regular expressions in workflows (#103)
Browse files Browse the repository at this point in the history
* Escape `[]` and `()` completely

* Avoid unnecessary escapes

* Tolerate tab for whitespace

* Tolerate other list markers

* Tolerate form-feed for whitespace in task lists
  • Loading branch information
sinsukehlab committed Apr 1, 2024
1 parent 1a6084e commit 6b04ecf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/1-add-headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: skills/action-check-file@v1
with:
file: "index.md"
search: "# [a-zA-Z0-9]"
search: "(?<!#)#{1,6}([\ \\t](.*))?$"

# In README.md, switch step 1 for step 2.
- name: Update to step 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/2-add-an-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: skills/action-check-file@v1
with:
file: "index.md"
search: "\\!\\[.*](.*)"
search: "\\!\\[.*\\]\\(.*\\)"

# In README.md, switch step 2 for step 3.
- name: Update to step 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3-add-a-code-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: skills/action-check-file@v1
with:
file: "index.md"
search: "\\`\\`\\`"
search: "```"

# In README.md, switch step 3 for step 4.
- name: Update to step 4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/4-make-a-task-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: skills/action-check-file@v1
with:
file: "index.md"
search: "\\- \\[ ] "
search: "([\\-\\+\\*]|[0-9]+\\.)[\ \\t]+\\[[\ \\t\\fxX]\\][\ \\t\\f]+\\S.*$"

# In README.md, switch step 4 for step 5.
- name: Update to step 5
Expand Down

0 comments on commit 6b04ecf

Please sign in to comment.