Skip to content

Commit 554e0fb

Browse files
fix: manual Docker builds only get SHA + custom tag
Disable branch/tag/semver/edge/latest tags for workflow_dispatch to ensure manual test builds don't pollute release tags.
1 parent bdf2045 commit 554e0fb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/docker-publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ jobs:
8888
tags: |
8989
type=schedule
9090
type=ref,event=branch
91-
type=ref,event=tag
91+
type=ref,event=tag,enable=${{ github.event_name != 'workflow_dispatch' }}
9292
type=ref,event=pr
93-
type=semver,pattern={{version}}
94-
type=semver,pattern={{major}}.{{minor}}
95-
type=semver,pattern={{major}}
93+
type=semver,pattern={{version}},enable=${{ github.event_name != 'workflow_dispatch' }}
94+
type=semver,pattern={{major}}.{{minor}},enable=${{ github.event_name != 'workflow_dispatch' }}
95+
type=semver,pattern={{major}},enable=${{ github.event_name != 'workflow_dispatch' }}
9696
type=sha
97-
type=edge
97+
type=edge,enable=${{ github.event_name != 'workflow_dispatch' }}
9898
# Custom tag for manual workflow dispatch
9999
type=raw,value=${{ inputs.tag }},enable=${{ inputs.tag != '' }}
100100
# Custom rule to prevent pre-releases from getting latest tag
101-
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
101+
type=raw,value=latest,enable=${{ github.event_name != 'workflow_dispatch' && github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-') }}
102102
103103
- name: Go Build Cache for Docker
104104
uses: actions/cache@v5

0 commit comments

Comments
 (0)