Skip to content

Commit 18f7307

Browse files
authored
Fixed axe workflow (alshedivat#2149)
Signed-off-by: George Araújo <[email protected]>
1 parent e977319 commit 18f7307

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

.github/workflows/axe.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ on:
1616
description: "URL to be checked (e.g.: blog/)"
1717
required: false
1818

19-
permissions:
20-
contents: write
21-
2219
env:
2320
URL: ""
2421

@@ -53,10 +50,24 @@ jobs:
5350
run: |
5451
npm install -g purgecss
5552
purgecss -c purgecss.config.js
53+
- name: Get Chromium version 🌐
54+
# https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#other-api-endpoints
55+
run: |
56+
CHROMIUM_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE | cut -d. -f1)
57+
echo "Chromium version: $CHROMIUM_VERSION"
58+
echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV
59+
- name: Setup Chrome 🌐
60+
id: setup-chrome
61+
uses: browser-actions/setup-chrome@v1
62+
with:
63+
chrome-version: ${{ env.CHROMIUM_VERSION }}
64+
- name: Install chromedriver 🚗
65+
run: |
66+
npm install -g chromedriver@$CHROMIUM_VERSION
5667
- name: Run axe 🪓
5768
# https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
5869
run: |
5970
npm install -g @axe-core/cli
6071
npm install -g http-server
6172
http-server _site/ &
62-
axe http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit
73+
axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit

.github/workflows/broken-links-site.yml

-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
workflows: [Deploy site]
66
types: [completed]
77

8-
permissions:
9-
contents: write
10-
118
jobs:
129
check-links-on-site:
1310
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow

0 commit comments

Comments
 (0)