Skip to content

Commit 6b04ecf

Browse files
authored
Fix regular expressions in workflows (#103)
* Escape `[]` and `()` completely * Avoid unnecessary escapes * Tolerate tab for whitespace * Tolerate other list markers * Tolerate form-feed for whitespace in task lists
1 parent 1a6084e commit 6b04ecf

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

.github/workflows/1-add-headers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: skills/action-check-file@v1
6060
with:
6161
file: "index.md"
62-
search: "# [a-zA-Z0-9]"
62+
search: "(?<!#)#{1,6}([\ \\t](.*))?$"
6363

6464
# In README.md, switch step 1 for step 2.
6565
- name: Update to step 2

.github/workflows/2-add-an-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: skills/action-check-file@v1
6060
with:
6161
file: "index.md"
62-
search: "\\!\\[.*](.*)"
62+
search: "\\!\\[.*\\]\\(.*\\)"
6363

6464
# In README.md, switch step 2 for step 3.
6565
- name: Update to step 3

.github/workflows/3-add-a-code-example.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: skills/action-check-file@v1
6060
with:
6161
file: "index.md"
62-
search: "\\`\\`\\`"
62+
search: "```"
6363

6464
# In README.md, switch step 3 for step 4.
6565
- name: Update to step 4

.github/workflows/4-make-a-task-list.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
uses: skills/action-check-file@v1
6060
with:
6161
file: "index.md"
62-
search: "\\- \\[ ] "
62+
search: "([\\-\\+\\*]|[0-9]+\\.)[\ \\t]+\\[[\ \\t\\fxX]\\][\ \\t\\f]+\\S.*$"
6363

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

0 commit comments

Comments
 (0)