From f6dd6f8dac2c20afd97d2fe23dc71e8e52048ab7 Mon Sep 17 00:00:00 2001 From: Heather Date: Tue, 28 May 2024 12:46:25 -0400 Subject: [PATCH] test variable for buildDir --- .github/workflows/accessibility_test.yml | 2 +- .github/workflows/scripts/check_for_changed_pages.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/accessibility_test.yml b/.github/workflows/accessibility_test.yml index f05edcd9cda..9e1700c3b2e 100644 --- a/.github/workflows/accessibility_test.yml +++ b/.github/workflows/accessibility_test.yml @@ -29,7 +29,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const { getChangedPages } = require('./.github/workflows/scripts/check_for_changed_pages.js'); - return getChangedPages({github, context}); + return getChangedPages({github, context}, env.BUILD_DIR); - name: Run site run: | python -m http.server 3000 -d ${{ env.BUILD_DIR }} & diff --git a/.github/workflows/scripts/check_for_changed_pages.js b/.github/workflows/scripts/check_for_changed_pages.js index 8a2a224ebbe..10a9391ba55 100644 --- a/.github/workflows/scripts/check_for_changed_pages.js +++ b/.github/workflows/scripts/check_for_changed_pages.js @@ -1,5 +1,6 @@ module.exports = { - getChangedPages: ({ github, context }) => { + getChangedPages: ({ github, context }, buildDir) => { + console.log('buildDir: ', buildDir); const fs = require('fs'); const cheerio = require('cheerio'); @@ -45,7 +46,7 @@ module.exports = { } }); - const siteMap = fs.readFileSync('client/www/next-build/sitemap.xml'); + const siteMap = fs.readFileSync(`${buildDir}/sitemap.xml`); const siteMapParse = cheerio.load(siteMap, { xml: true