-
Notifications
You must be signed in to change notification settings - Fork 288
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
fetch git tags so that trivy sees the right binary version #1887
Conversation
8ad7e15
to
01fb59e
Compare
3fe79ed
to
b083c0b
Compare
@@ -42,6 +42,8 @@ jobs: | |||
runs-on: "buildjet-2vcpu-ubuntu-2204" | |||
steps: | |||
- uses: "actions/checkout@v4" | |||
with: | |||
fetch-depth: 0 |
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.
should this be fetch-tags or does this work?
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.
Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth: 0 to fetch all history for all branches and tags. Refer here to learn which commit $GITHUB_SHA points to for different events.
We should add a comment to this line
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.
should this be fetch-tags or does this work?
@ecordell I tried that first. For some reason that didn't work. Could be an issue with the GH action, so I went the easy route
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.
this fixes an issue with trivy where it flags SpiceDB as vulnerable, possibly as of aquasecurity/trivy#6564 include in version 0.51.0. It's flagged because it parses it as version 0.0.1-next as generated by goreleaser, because it does not have the tags available
b083c0b
to
7643701
Compare
this fixes an issue with trivy where it flags SpiceDB as vulnerable, possibly as of aquasecurity/trivy#6564 include in version 0.51.0. It's flagged because it parses it as version 0.0.1-next.
Because the
checkout
action does not fetch the tags by default, goreleaser is unable the generate the right version.