-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure releases only use released versions of syft
Signed-off-by: Alex Goodman <[email protected]>
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
version=$(grep -E "github.com/anchore/syft" go.mod | awk '{print $NF}') | ||
|
||
# ensure that the version is a release version (not a commit hash) | ||
# a release in this case means that the go tooling resolved the version to a tag | ||
# this does not guarantee that the tag has a github release associated with it | ||
if [[ ! $version =~ ^v[0-9]+\.[0-9]+\.[0-9]?$ ]]; then | ||
echo "syft version in go.mod is not a release version: $version" | ||
echo "please update the version in go.mod to a release version and try again" | ||
exit 1 | ||
else | ||
echo "syft version in go.mod is a release version: $version" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters