Skip to content

Commit

Permalink
Fix conditional PA11Y_TARGETS env var checking
Browse files Browse the repository at this point in the history
  • Loading branch information
caleywoods committed May 22, 2024
1 parent 378417b commit c1d5057
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ jobs:
bundle exec jekyll build
if test -f pa11y_targets; then
echo "export PA11Y_TARGETS=$(cat pa11y_targets | base64 --wrap=0)" >> "$BASH_ENV"
echo "Changed files detected, pa11y scan will be performed on those files."
source "$BASH_ENV"
else
echo "No changed files detected, pa11y scan will be skipped."
fi
- run: npm run htmlproofer
- run:
Expand All @@ -65,7 +68,9 @@ jobs:
steps:
- run:
name: Run full pa11y scan
command: ./serve-pa11yci && npm run pa11y-sitemap
command: |
echo "Doing full pa11y scan."
./serve-pa11yci && npm run pa11y-sitemap
# When someone pushes to a branch on GitHub with an open pull request
# it makes a webhook POST to CircleCI that satisfies this condition
- when:
Expand All @@ -76,10 +81,10 @@ jobs:
name: Run pa11y scan on changed files
command: |
if [[ -z "${PA11Y_TARGETS}" ]]; then
npm run pa11y-ci -- $(echo $PA11Y_TARGETS | base64 --decode)
else
echo "The pa11y targets environment variable was not found, no pa11y scan performed."
exit 1
else
npm run pa11y-ci -- $(echo $PA11Y_TARGETS | base64 --decode)
fi
workflows:
version: 2
Expand Down

0 comments on commit c1d5057

Please sign in to comment.