Skip to content

Commit 913e223

Browse files
author
Ronaldo Macapobre
committed
Refactor release tag handling in workflows to use GitHub ref for image tagging
1 parent 69b1e3e commit 913e223

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/workflows/publish-api-select.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ on:
1515
- dev
1616
- test
1717
- prod
18-
release_tag:
19-
description: 'Release tag to deploy (e.g. v1.2.3). Leave empty to use the current commit SHA.'
20-
required: false
21-
type: string
2218

2319
env:
2420
WORKING_DIRECTORY: .
@@ -62,8 +58,8 @@ jobs:
6258
- name: Get Image Tag
6359
id: version
6460
run: |
65-
if [[ -n "${{ github.event.inputs.release_tag }}" ]]; then
66-
VERSION="${{ github.event.inputs.release_tag }}"
61+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
62+
VERSION="${{ github.ref_name }}"
6763
echo "IMAGE_TAG=${VERSION#v}" >> $GITHUB_OUTPUT
6864
echo "RELEASE_VERSION=${VERSION#v}" >> $GITHUB_OUTPUT
6965
else

.github/workflows/publish-api.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ jobs:
5353
- name: Get Image Tag
5454
id: version
5555
run: |
56-
if [[ "${{ github.event_name }}" == "release" ]]; then
57-
VERSION="${{ github.event.release.tag_name }}"
56+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
57+
VERSION="${{ github.ref_name }}"
5858
echo "IMAGE_TAG=${VERSION#v}" >> $GITHUB_OUTPUT
5959
echo "RELEASE_VERSION=${VERSION#v}" >> $GITHUB_OUTPUT
6060
else

0 commit comments

Comments
 (0)