Update .github/scripts/check-quality.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Avelino 2025-09-14 14:55:58 -03:00
parent 8a1c8ef576
commit 1a93ba0fab

View File

@ -99,9 +99,10 @@ async function checkGithubRepo(repoUrl) {
const hasGoMod = await fetchJson(`${base}/repos/${owner}/${repo}/contents/go.mod`, headers);
const releases = await fetchJson(`${base}/repos/${owner}/${repo}/releases`, headers);
const hasRelease = Array.isArray(releases) && releases.some((r) => /^v\d+\.\d+\.\d+/.test(r.tag_name || ''));
const hasGoModOk = Boolean(hasGoMod && hasGoMod.name === 'go.mod');
return {
ok: Boolean(hasGoMod && hasGoMod.name === 'go.mod' && hasRelease),
reason: !hasGoMod ? 'missing go.mod' : !hasRelease ? 'missing semver release' : undefined,
ok: Boolean(hasGoModOk && hasRelease),
reason: !hasGoModOk ? 'missing go.mod' : !hasRelease ? 'missing semver release' : undefined,
};
}