fix(ci): fallback to previous release when attempting unreleased version #1568
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When RELEASE_VERSIONS.txt is updated to a new unreleased minor version, the
diff-dumps
job fails to upload the latest offline vulnerability data. That is because (as mentioned, the latest minor version does not exist, so we we attempt to pull its related data, there is nothing there.This PR now will check if the latest version is unreleased. If that's the case, then it falls back to the latest released version, so offline vuln updates may continue.
We determine if there is a release by checking for the existence of the tag in the stackrox/stackrox repo. If it returns a 200, it exists. If it returns a 404, then it doesn't exist. Any other status code means there is some other kind of error, so we should fail