Skip to content

Commit bcfc947

Browse files
authored
Fix setting the release tag (#115)
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent d90f676 commit bcfc947

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/publish.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,15 @@ jobs:
3434
- name: Compute version number
3535
id: version-string
3636
run: |
37-
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
38-
# For main branch, use semver with -dev suffix
39-
echo "tag=0.0.1-dev.$GITHUB_RUN_NUMBER+$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
40-
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
41-
# For tags, use the tag as is (assuming it's semver)
37+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
38+
# For tags, use the tag as is
4239
TAG="${{ github.ref_name }}"
43-
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
4440
else
45-
# For other branches, use branch name and run number
46-
BRANCH="${{ github.ref_name }}"
47-
echo "tag=0.0.1-$BRANCH.$GITHUB_RUN_NUMBER+$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
41+
# Fallback to using the input tag
42+
TAG="${{ github.event.inputs.tag }}"
4843
fi
44+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
45+
echo "Using tag: $TAG"
4946
5047
- name: Log in to the Container registry
5148
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0

0 commit comments

Comments
 (0)