Skip to content

Commit 45ef897

Browse files
authored
ci: fetch tags to make trivy scan pass (#7357)
Signed-off-by: Shahar Harari <[email protected]>
1 parent 5df0078 commit 45ef897

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/trivy.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
22+
# We need to fetch tags so go binary will be built with the recent vX.Y.Z-rc.0 tag,
23+
# which will help to avoid false positives in trivy scan.
24+
# `fetch-tags: true` doesn't work: https://github.com/actions/checkout/issues/1471
25+
# As a workaround `filter: tree:0` is used to create a treeless clone.
26+
# See:
27+
# https://github.com/actions/checkout/issues/1471#issuecomment-1755639487
28+
# https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/
29+
with:
30+
fetch-depth: 0
31+
filter: tree:0
2232

2333
- name: Build an image from Dockerfile
2434
run: |

0 commit comments

Comments
 (0)