Skip to content

Commit f588a5c

Browse files
committed
ci(release): fix tag format validation in nuget workflow
1 parent 2df229d commit f588a5c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/nuget.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Validate tag format (YYYY.MM.0 expected)
20-
if: startsWith(github.event.release.tag_name, format('{0}.{1}.', format('{0,number,0000}', fromJson('{"y":0}').y), format('{0,number,00}', fromJson('{"m":0}').m))) == false
21-
run: echo "Saltando validación personalizada (placeholder)" # (Opcional: se puede reemplazar por validación estricta)
19+
- name: Validate tag format (YYYY.MM.PATCH expected)
20+
run: |
21+
TAG="${{ github.event.release.tag_name }}"
22+
echo "Validating tag format: $TAG"
23+
# Accept tags like 2025.11.0 or 2025.1.2 (year. month. patch)
24+
if [[ ! $TAG =~ ^[0-9]{4}\.[0-9]{1,2}\.[0-9]+$ ]]; then
25+
echo "Invalid tag format: $TAG. Expected format: YYYY.MM.PATCH (e.g. 2025.11.0)"
26+
exit 1
27+
fi
2228
2329
- name: Setup .NET 10
2430
uses: actions/setup-dotnet@v4

0 commit comments

Comments
 (0)