-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pin versions and fix permissions, concurrency
- Loading branch information
1 parent
2442736
commit f9eaa08
Showing
1 changed file
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,21 +6,30 @@ on: | |
pull_request: | ||
workflow_dispatch: | ||
|
||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pa11y: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # [email protected] | ||
|
||
- name: Install Chrome | ||
uses: browser-actions/setup-chrome@latest | ||
|
||
uses: browser-actions/setup-chrome@facf10a55b9caf92e0cc749b4f82bf8220989148 # [email protected] | ||
# We're no longer building the site, so we don't need | ||
# to use the site's version of Node -- just something | ||
# that's supposed by Cloud.gov Pages (currently 18.19.0) | ||
- name: Use Node | ||
uses: actions/setup-node@v3 | ||
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # pin@v3 | ||
with: | ||
node-version: '18' | ||
|
||
|
@@ -62,7 +71,7 @@ jobs: | |
|
||
- name: Read pa11y_output file. | ||
id: pa11y_output | ||
uses: juliangruber/read-file-action@v1 | ||
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # [email protected] | ||
with: | ||
path: ./pa11y_output.txt | ||
|
||
|
@@ -73,17 +82,14 @@ jobs: | |
exit 1 | ||
- name: Comment on pull request. | ||
uses: thollander/actions-comment-pull-request@v2 | ||
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # [email protected] | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
message: "<details><summary>Pa11y testing results</summary> | ||
```${{ steps.pa11y_output.outputs.content }}``` | ||
</details>" | ||
message: "<details><summary>Pa11y testing results</summary> ```${{ steps.pa11y_output.outputs.content }}``` </details>" | ||
|
||
- name: Check for pa11y failures. | ||
if: contains(steps.pa11y_output.outputs.content, 'errno 2') | ||
run: | | ||
echo "::error::The site is failing accessibility tests." | ||
echo "Please review the comment in the pull request for details." | ||
exit 1 | ||