diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec3d03f3..c9c87b86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: 22 cache: npm - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v7 with: python-version: "3.12" - run: | diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 141d8e97..1f0eb363 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -12,10 +12,10 @@ jobs: commits: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v7 with: node-version: 22 - run: node scripts/verify-commit-words.mjs "$RANGE" diff --git a/.github/workflows/generated.yml b/.github/workflows/generated.yml index 075d20ad..2b1adf5f 100644 --- a/.github/workflows/generated.yml +++ b/.github/workflows/generated.yml @@ -18,8 +18,8 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: 22 cache: npm diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f8cb277f..c47c9e1d 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -30,12 +30,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: 22 cache: npm - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v7 with: python-version: "3.12" - name: Install @@ -91,10 +91,14 @@ jobs: env: OW_SCHEMA_DIST: ${{ runner.temp }}/schema-dist run: npm run verify - - uses: actions/configure-pages@v5 - - uses: actions/upload-pages-artifact@v3 + - uses: actions/configure-pages@v6 + - uses: actions/upload-pages-artifact@v5 with: path: dist + # Since its v4 this action leaves dot-named files and folders out of the site unless told + # otherwise, and the site serves /.well-known/security.txt. The URL gate above reads dist/ + # before the upload and cannot see a file the upload drops; verify-workflows holds this line. + include-hidden-files: true deploy: needs: build @@ -104,7 +108,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5 # Every deploy from a push or a manual run is tagged docs-live--, so a rollback is a # manual run of this workflow on the previous tag. Scheduled and schema-dist rebuilds are not tagged @@ -116,7 +120,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - run: | tag="docs-live-$(date -u +%Y-%m-%d)-${GITHUB_RUN_NUMBER}" git tag "$tag" "$GITHUB_SHA" diff --git a/.github/workflows/practice.yml b/.github/workflows/practice.yml index 28c8182f..93d75fb3 100644 --- a/.github/workflows/practice.yml +++ b/.github/workflows/practice.yml @@ -17,12 +17,12 @@ jobs: write-examples: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 with: node-version: 22 cache: npm - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v7 with: python-version: "3.12" - name: Install the SDK as pinned, and the newest Python package diff --git a/scripts/verify-workflows.mjs b/scripts/verify-workflows.mjs index 26e735d9..916958a0 100644 --- a/scripts/verify-workflows.mjs +++ b/scripts/verify-workflows.mjs @@ -25,4 +25,39 @@ for (const f of files) { } } if (bad) { console.log(`FAIL: ${bad} workflow file(s) would not run`); process.exit(1); } -console.log(`PASS: ${files.length} workflow file(s) parse`); + +// The Pages upload and dot-named paths. Since its v4, actions/upload-pages-artifact leaves every file and +// folder whose name starts with a dot out of the site unless the step sets `include-hidden-files: true`. +// The site serves such paths (public/.well-known/security.txt), and the URL gate reads dist/ before the +// upload, so nothing else sees them dropped. While public/ holds a dot-named path, every upload step at +// v4 or later, or at a ref this cannot read a major from, must carry the input. +const PUBLIC = join(DIR, '..', '..', 'public'); +const dotted = []; +(function walk(dir, rel) { + for (const e of readdirSync(dir, { withFileTypes: true })) { + const at = rel ? `${rel}/${e.name}` : e.name; + if (e.name.startsWith('.')) dotted.push(at); + else if (e.isDirectory()) walk(join(dir, e.name), at); + } +})(PUBLIC, ''); +let uploads = 0; +const dropped = []; +for (const f of files) { + const doc = parse(readFileSync(join(DIR, f), 'utf8')); + for (const [job, def] of Object.entries(doc.jobs)) { + for (const step of def.steps ?? []) { + const m = /^actions\/upload-pages-artifact@(.+)$/.exec(String(step.uses ?? '')); + if (!m) continue; + uploads++; + const major = /^v(\d+)/.exec(m[1])?.[1]; + const keeps = step.with?.['include-hidden-files'] === true || step.with?.['include-hidden-files'] === 'true'; + if (dotted.length && !(major && Number(major) < 4) && !keeps) dropped.push(`${f}: job ${job} uploads the site with upload-pages-artifact@${m[1]} and no include-hidden-files: true`); + } + } +} +if (dropped.length) { + for (const d of dropped) console.log(` DROPS ${d}`); + console.log(`FAIL: the deploy would leave ${dotted.length} dot-named path(s) out of the site (${dotted.slice(0, 3).join(', ')})`); + process.exit(1); +} +console.log(`PASS: ${files.length} workflow file(s) parse; ${uploads} Pages upload step(s) keep the site's ${dotted.length} dot-named path(s)`);