Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: tweak docs version audit #680

Merged
merged 1 commit into from
Nov 19, 2024
Merged
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
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