Skip to content
Snippets Groups Projects
Commit e516a226 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: check bazel versions for stable/unstable

parent 352ac766
No related branches found
No related tags found
No related merge requests found
const semver = require('semver');
const stable = require('semver-stable');
const { getRepoTags, getRepoReleases } = require('../../datasource/github');
module.exports = {
......@@ -20,9 +21,19 @@ async function getPackageUpdates(config) {
return [];
}
const repo = remote.substring(githubHost.length).replace(/.git$/, '');
const tags = await getRepoTags(repo);
let tags = await getRepoTags(repo);
logger.debug({ tags, remote });
// istanbul ignore if
if (!tags.length) {
logger.warn({ repo }, 'No tags found');
return [];
}
if (stable.is(currentVersion)) {
tags = tags.filter(tag => stable.is(tag));
}
const [newestTag] = tags.slice(-1);
if (semver.gt(newestTag, currentVersion)) {
if (newestTag && semver.gt(newestTag, currentVersion)) {
logger.debug({ newestTag }, 'Found newer tag');
return [
{
newVersion: newestTag,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment