Skip to content

Commit 191b02d

Browse files
committed
fix variables
1 parent b1f84ba commit 191b02d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

.github/workflows/axe.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
docs/content/utilities/index.md
2626
- name: Save changed files
2727
run: |
28-
echo "MODIFIED_COMPONENT_OR_UTILITIES_PATHS=${{ steps.changed-files.outputs.all_changed_files }}" >> $GITHUB_ENV
28+
echo "CHANGED_DOCS_PATH=(${{ steps.changed-files.outputs.all_changed_files }})" >> $GITHUB_ENV
2929
- name: Use Node.js
3030
if: steps.changed-files.outputs.any_changed == 'true'
3131
uses: actions/setup-node@v3
@@ -42,4 +42,4 @@ jobs:
4242
- name: Run axe script
4343
if: steps.changed-files.outputs.any_changed == 'true'
4444
run: |
45-
script/axe-docs $MODIFIED_COMPONENT_OR_UTILITIES_PATHS
45+
script/axe-docs $CHANGED_DOCS_PATH

script/axe-docs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
# Developers frequently copy and paste examples from documentation so it's important to ensure the examples are accessible.
55
# Learn about @axe-core/cli: https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
66

7-
array=($MODIFIED_COMPONENT_OR_UTILITIES_PATHS)
8-
printf "%s\n" "${array[@]}" > temp.txt
7+
if [ ${#CHANGED_DOCS_PATH[@]} -eq 0 ]; then
8+
echo "CHANGED_DOCS_PATH must be set to run axe checks."
9+
exit
10+
fi
911

10-
# Store the paths of pages we care about
12+
printf "%s\n" "${CHANGED_DOCS_PATH[@]}" > temp.txt
1113
nav_paths=()
1214
while IFS= read -r file
1315
do
@@ -19,11 +21,7 @@ do
1921
done < temp.txt
2022
rm temp.txt
2123

22-
# Return early if no relevant files were modified
23-
echo "Verify whether ${nav_paths[@]} is part of starting point violation"
24-
echo "*"
25-
echo "*"
26-
24+
echo $nav_paths
2725
# https://stackoverflow.com/a/8574392
2826
containsElement () {
2927
local e match="$1"
@@ -32,9 +30,9 @@ containsElement () {
3230
return 1
3331
}
3432

35-
# Starting point violations
33+
# Starting point violations list
3634
# DO NOT ADD TO THIS LIST!
37-
skipped=(
35+
needs_to_be_fixed=(
3836
/components/autocomplete
3937
/components/avatars
4038
/components/box
@@ -56,8 +54,8 @@ skipped=()
5654
for i in "${nav_paths[@]}";
5755
do
5856
if containsElement "${i//\"/}" "${needs_to_be_fixed[@]}"; then
57+
echo "Skipping $i"
5958
skipped+=($i)
60-
continue
6159
else
6260
doc_url="http://localhost:8000$i"
6361
doc_url="${doc_url//\"/}"
@@ -66,16 +64,18 @@ do
6664
done
6765

6866
if (( ${#skipped[@]} )); then
69-
echo "############################################################"
67+
echo "==========================================================================================="
7068
echo "WARNING"
71-
echo "The following paths are excluded from axe checks because they are part of starting point violations:"
72-
printf '%s\n' "${needs_to_be_fixed[@]}"
7369
echo ""
70+
echo "Oh no! We had to skip accessibility checks on:"
7471
echo ""
75-
echo "While you're working in:"
7672
printf '%s\n' "${skipped[@]}"
77-
echo "will you consider fixing the accessibility issues so we can remove it from the list? ❤️"
78-
echo "############################################################"
73+
echo ""
74+
echo "because they are part of the starting point violations list."
75+
echo ""
76+
echo "Help us get one closer to getting rid of this list!"
77+
echo "Consider addressing the accessibility issues on the examples of these pages as part of your PR ❤️"
78+
echo "==========================================================================================="
7979
fi
8080

8181
# Run axe checks only if there are pages to run it on

0 commit comments

Comments
 (0)