Skip to content

Commit 325e239

Browse files
committed
Fix workflow Docker tag for branch names with slashes
1 parent a69a65c commit 325e239

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎.github/workflows/release_and_packages.yml‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,22 @@ jobs:
127127

128128
# The image path is lowercase literal on purpose: GHCR rejects uppercase
129129
# repository names, and github.repository_owner is "BiosSystem".
130+
- name: Sanitize image tag
131+
id: sanitize
132+
run: |
133+
REF_NAME="${{ github.ref_name }}"
134+
echo "safe_tag=${REF_NAME//\//-}" >> $GITHUB_OUTPUT
135+
130136
- name: Build and push Docker image
131137
uses: docker/build-push-action@v7
132138
with:
133139
context: .
134140
push: true
135-
tags: ghcr.io/biossystem/originalms:latest,ghcr.io/biossystem/originalms:${{ github.ref_name }}
141+
tags: ghcr.io/biossystem/originalms:latest,ghcr.io/biossystem/originalms:${{ steps.sanitize.outputs.safe_tag }}
136142
cache-from: type=gha
137143
cache-to: type=gha,mode=max
138144

139145

140146

141147

148+

0 commit comments

Comments
 (0)