From 158e56e4f778381005d893605985e3dc14076ef7 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 16 Jan 2026 21:56:08 -0800 Subject: [PATCH 1/2] ci: update docs version audit to work off releases --- .github/workflows/audit-docs-version.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/audit-docs-version.yml b/.github/workflows/audit-docs-version.yml index 5e51aa125..1e8852a8e 100644 --- a/.github/workflows/audit-docs-version.yml +++ b/.github/workflows/audit-docs-version.yml @@ -39,27 +39,28 @@ jobs: const versions = await ElectronVersions.create({ ignoreCache: true }); - const { data } = await github.rest.repos.listCommits({ + const { data: { published_at: publishedAt } } = await github.rest.repos.getReleaseByTag({ owner: 'electron', repo: 'electron', - sha: `${versions.latestStable.major}-x-y`, - path: 'docs/', - per_page: 1 + tag: `v${versions.latestStable.version}`, }); - const commit = data[0]; - const { date } = commit.commit.committer; - const delta = Date.now() - new Date(date).getTime(); + const { data: commit } = await github.rest.repos.getCommit({ + owner: 'electron', + repo: 'electron', + ref: `tags/v${versions.latestStable.version}`, + }); + + const delta = Date.now() - new Date(publishedAt).getTime(); - // If the commit happened recently, wait a bit for the site + // If the release was published recently, wait a bit for the site // to deploy before checking so we don't get a false positive if (delta < DELTA_THRESHOLD_MS) { await setTimeout(DELTA_THRESHOLD_MS - delta); } if (commit.sha !== latestDocsSHA) { - // A bug in `electron-website-updater` sometimes sends up new commits that - // touched any file with `docs` in the name, so allow commits to be newer + // Allow commits to be newer in case we want to deploy a docs hotfix const comparison = await github.rest.repos.compareCommitsWithBasehead({ owner: 'electron', repo: 'electron', From 1bd87eecbfda52e1f15a4d2183b1b1c29de44299 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Fri, 16 Jan 2026 22:03:14 -0800 Subject: [PATCH 2/2] chore: use fully qualified refs/tags for `getCommit` GitHub docs are wrong --- .github/workflows/audit-docs-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/audit-docs-version.yml b/.github/workflows/audit-docs-version.yml index 1e8852a8e..75d32f1b3 100644 --- a/.github/workflows/audit-docs-version.yml +++ b/.github/workflows/audit-docs-version.yml @@ -48,7 +48,7 @@ jobs: const { data: commit } = await github.rest.repos.getCommit({ owner: 'electron', repo: 'electron', - ref: `tags/v${versions.latestStable.version}`, + ref: `refs/tags/v${versions.latestStable.version}`, }); const delta = Date.now() - new Date(publishedAt).getTime();