-
Notifications
You must be signed in to change notification settings - Fork 14
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
Filter Release Tags #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one suggestion for the sake of regression testing
{ | ||
tag_name: "4.3.0", | ||
assets: [] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for good measure, can we add one that starts with v
but isn't valid? 😀
function filterValidReleases(releases: GitHubRelease[]): GitHubRelease[] { | ||
return releases.filter(release => { | ||
const tag = release.tag_name; | ||
return tag.startsWith("v") && semver.valid(tag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that semver.valid
must handle the leading v
just fine, since your tests appear to pass
The current behavior is for setup-foreman to fail if it encounters an invalid semver tag in the Foreman repo. This PR looks to
add a filter step to filter out invalid semver tags.