Skip to content

Commit e2f8e6f

Browse files
committed
fix: overwrite labels and annotations
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 2465b8d commit e2f8e6f

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/publish-docker-image.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,16 @@ jobs:
3737
with:
3838
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3939
tags: |
40-
type=sha,event=workflow_dispatch
40+
type=sha,event=workflow_dispatch,enable=${{ !startsWith(github.ref, 'refs/tags/') }}
4141
type=semver,pattern={{version}}
42-
type=raw,value=latest,event=tag
42+
labels: |
43+
org.opencontainers.image.title=VulnerableCode
44+
org.opencontainers.image.description=A free and open vulnerability database with tools to track, aggregate, and correlate package vulnerabilities
45+
org.opencontainers.image.licenses=Apache-2.0
46+
annotations: |
47+
org.opencontainers.image.title=VulnerableCode
48+
org.opencontainers.image.description=A free and open vulnerability database with tools to track, aggregate, and correlate package vulnerabilities
49+
org.opencontainers.image.licenses=Apache-2.0
4350
4451
- name: Set up Docker Buildx
4552
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
@@ -49,13 +56,12 @@ jobs:
4956
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
5057
with:
5158
context: .
52-
push: ${{ github.event_name != 'workflow_dispatch' }}
59+
push: true
5360
tags: ${{ steps.meta.outputs.tags }}
5461
labels: ${{ steps.meta.outputs.labels }}
5562
annotations: ${{ steps.meta.outputs.annotations }}
5663

5764
- name: Generate artifact attestation
58-
if: github.event_name != 'workflow_dispatch'
5965
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
6066
with:
6167
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}

0 commit comments

Comments
 (0)