From 5753e7ff6e804dabeb52b9bdd2e39d722e13a684 Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 6 May 2025 07:56:43 +1200 Subject: [PATCH 1/5] Adds build condition for pushing to latest on main scheduled build --- .github/workflows/insights-trivy-image.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/insights-trivy-image.yaml b/.github/workflows/insights-trivy-image.yaml index b5b4257b..9782b54c 100644 --- a/.github/workflows/insights-trivy-image.yaml +++ b/.github/workflows/insights-trivy-image.yaml @@ -77,6 +77,8 @@ jobs: tags: | # set edge tag for default branch type=edge,enable={{is_default_branch}} + # set latest tag for main branch - this is require for the scheduled builds + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} # set tag+build for default branch type=raw,value=${{ env.DOCKER_TAG}},enable={{is_default_branch}} # tag event From b71881a240fcac486d7cad8a426bec7103706bbc Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 6 May 2025 07:59:02 +1200 Subject: [PATCH 2/5] Fixes typo --- .github/workflows/insights-trivy-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/insights-trivy-image.yaml b/.github/workflows/insights-trivy-image.yaml index 9782b54c..fe850510 100644 --- a/.github/workflows/insights-trivy-image.yaml +++ b/.github/workflows/insights-trivy-image.yaml @@ -77,7 +77,7 @@ jobs: tags: | # set edge tag for default branch type=edge,enable={{is_default_branch}} - # set latest tag for main branch - this is require for the scheduled builds + # set latest tag for main branch - this is required for the scheduled builds type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} # set tag+build for default branch type=raw,value=${{ env.DOCKER_TAG}},enable={{is_default_branch}} From 25afe1a6d352eeb7e0655b814060979163043c27 Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 6 May 2025 08:07:01 +1200 Subject: [PATCH 3/5] Specifies default branch rather than main --- .github/workflows/insights-trivy-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/insights-trivy-image.yaml b/.github/workflows/insights-trivy-image.yaml index fe850510..c92f746f 100644 --- a/.github/workflows/insights-trivy-image.yaml +++ b/.github/workflows/insights-trivy-image.yaml @@ -78,7 +78,7 @@ jobs: # set edge tag for default branch type=edge,enable={{is_default_branch}} # set latest tag for main branch - this is required for the scheduled builds - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=raw,value=latest,enable=${{is_default_branch}} # set tag+build for default branch type=raw,value=${{ env.DOCKER_TAG}},enable={{is_default_branch}} # tag event From 89086d0c6dfa6aeb366c06603b74bc230ab8edaa Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 6 May 2025 08:08:20 +1200 Subject: [PATCH 4/5] Fixes syntax error --- .github/workflows/insights-trivy-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/insights-trivy-image.yaml b/.github/workflows/insights-trivy-image.yaml index c92f746f..2cffbf56 100644 --- a/.github/workflows/insights-trivy-image.yaml +++ b/.github/workflows/insights-trivy-image.yaml @@ -78,7 +78,7 @@ jobs: # set edge tag for default branch type=edge,enable={{is_default_branch}} # set latest tag for main branch - this is required for the scheduled builds - type=raw,value=latest,enable=${{is_default_branch}} + type=raw,value=latest,enable={{is_default_branch}} # set tag+build for default branch type=raw,value=${{ env.DOCKER_TAG}},enable={{is_default_branch}} # tag event From 3a24aa35ede4c454d1359e7f9a575353aa82e148 Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 6 May 2025 12:35:33 +1200 Subject: [PATCH 5/5] Adds schedule type event tag --- .github/workflows/insights-trivy-image.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/insights-trivy-image.yaml b/.github/workflows/insights-trivy-image.yaml index 2cffbf56..1d385c38 100644 --- a/.github/workflows/insights-trivy-image.yaml +++ b/.github/workflows/insights-trivy-image.yaml @@ -88,6 +88,9 @@ jobs: type=ref,event=pr # pull request event type=ref,event=branch + #schedule event tags - gives us a tag per day + type=schedule,pattern={{date 'YYYYMMDD'}} + type=schedule,value=latest - name: Set up QEMU uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0