Skip to content

Commit

Permalink
chore: tweak docs version audit (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanders11 authored Nov 19, 2024
1 parent e8bf718 commit 8e17eba
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/audit-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ jobs:
const versions = await ElectronVersions.create(undefined, { ignoreCache: true });
const { data } = await github.rest.repos.getBranch({
const { data } = await github.rest.repos.listCommits({
owner: 'electron',
repo: 'electron',
branch: `${versions.latestStable.major}-x-y`,
sha: `${versions.latestStable.major}-x-y`,
path: 'docs/',
per_page: 1
});
const commit = data[0];
const { date } = data.commit.commit.committer;
const { date } = commit.commit.committer;
const delta = Date.now() - new Date(date).getTime();
// If the commit happened recently, wait a bit for the site
Expand All @@ -49,7 +52,8 @@ jobs:
await setTimeout(DELTA_THRESHOLD_MS - delta);
}
if (data.commit.sha !== latestDocsSHA) {
if (commit.sha !== latestDocsSHA) {
console.log(`Got ${latestDocsSHA}, expected ${commit.sha}`);
core.summary.addRaw('🚨 Docs are NOT up-to-date');
// Set this as failed so it's easy to scan runs to find failures
Expand Down

0 comments on commit 8e17eba

Please sign in to comment.