Skip to content

Commit 9b75d0e

Browse files
authored
handle github version tags without a 'v' (#682)
ensure that resources are stored in the expected paths regardless of tag format
1 parent c5b4148 commit 9b75d0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/release-prod.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ jobs:
1414
with:
1515
fetch-depth: 0
1616
- name: Extract tag name
17-
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
17+
run: |
18+
# remove the "refs/tags/" prefix to get the tag that was pushed
19+
export RAW_TAG=${GITHUB_REF#refs/tags/}
20+
# add a 'v' prefix to the tag if it doesn't already have one
21+
export V_TAG=$(echo "$RAW_TAG" | sed 's/^[^v]/v&/')
22+
# store the tag name in a github environment variable for later steps
23+
echo "TAG_NAME=${V_TAG}" >> $GITHUB_ENV
1824
- name: Set up Go
1925
uses: actions/setup-go@v5
2026
with:

0 commit comments

Comments
 (0)