mirror of
https://github.com/avelino/awesome-go.git
synced 2026-04-11 02:11:43 +08:00
Update .github/scripts/check-quality.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
8a1c8ef576
commit
1a93ba0fab
5
.github/scripts/check-quality.js
vendored
5
.github/scripts/check-quality.js
vendored
@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user