From 18f7307e07a0d9221ba451a22c6ca5c58394a7df Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Tue, 30 Jan 2024 15:16:15 -0300 Subject: [PATCH] Fixed axe workflow (#2149) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: George Araรบjo --- .github/workflows/axe.yml | 19 +++++++++++++++---- .github/workflows/broken-links-site.yml | 3 --- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/axe.yml b/.github/workflows/axe.yml index e1b49d447360..a745c7dc9bed 100644 --- a/.github/workflows/axe.yml +++ b/.github/workflows/axe.yml @@ -16,9 +16,6 @@ on: description: "URL to be checked (e.g.: blog/)" required: false -permissions: - contents: write - env: URL: "" @@ -53,10 +50,24 @@ jobs: run: | npm install -g purgecss purgecss -c purgecss.config.js + - name: Get Chromium version ๐ŸŒ + # https://github.com/GoogleChromeLabs/chrome-for-testing?tab=readme-ov-file#other-api-endpoints + run: | + CHROMIUM_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE | cut -d. -f1) + echo "Chromium version: $CHROMIUM_VERSION" + echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV + - name: Setup Chrome ๐ŸŒ + id: setup-chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: ${{ env.CHROMIUM_VERSION }} + - name: Install chromedriver ๐Ÿš— + run: | + npm install -g chromedriver@$CHROMIUM_VERSION - name: Run axe ๐Ÿช“ # https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli run: | npm install -g @axe-core/cli npm install -g http-server http-server _site/ & - axe http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit + axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver http://localhost:8080/${{ github.event.inputs.url || env.URL }} --load-delay=1500 --exit diff --git a/.github/workflows/broken-links-site.yml b/.github/workflows/broken-links-site.yml index 779eefff328e..fae797c8977f 100644 --- a/.github/workflows/broken-links-site.yml +++ b/.github/workflows/broken-links-site.yml @@ -5,9 +5,6 @@ on: workflows: [Deploy site] types: [completed] -permissions: - contents: write - jobs: check-links-on-site: # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow