Skip to content
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

Merged
merged 1 commit into from
May 3, 2024

Conversation

vroldanbet
Copy link
Contributor

@vroldanbet vroldanbet commented May 3, 2024

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.

@vroldanbet vroldanbet requested a review from a team as a code owner May 3, 2024 16:16
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label May 3, 2024
@vroldanbet vroldanbet force-pushed the fix-trivy-goreleaser branch 2 times, most recently from 8ad7e15 to 01fb59e Compare May 3, 2024 16:29
@vroldanbet vroldanbet changed the title fetch tags so that goreleaser generates the right binary version fetch git tags so that trivy sees the right binary version May 3, 2024
@vroldanbet vroldanbet requested a review from jzelinskie May 3, 2024 16:44
@vroldanbet vroldanbet force-pushed the fix-trivy-goreleaser branch 2 times, most recently from 3fe79ed to b083c0b Compare May 3, 2024 16:46
ecordell
ecordell previously approved these changes May 3, 2024
@@ -42,6 +42,8 @@ jobs:
runs-on: "buildjet-2vcpu-ubuntu-2204"
steps:
- uses: "actions/checkout@v4"
with:
fetch-depth: 0
Copy link
Contributor

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?

Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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
@vroldanbet vroldanbet added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit e075df4 May 3, 2024
22 checks passed
@vroldanbet vroldanbet deleted the fix-trivy-goreleaser branch May 3, 2024 17:27
@github-actions github-actions bot locked and limited conversation to collaborators May 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants