Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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-<date>-<run>, so a rollback is a
# manual run of this workflow on the previous tag. Scheduled and schema-dist rebuilds are not tagged
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/practice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 36 additions & 1 deletion scripts/verify-workflows.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)`);
Loading