Skip to content

Commit 4c82ee6

Browse files
authored
Add GitHub Actions workflow fci(governance): add tag gate workflowor tag validation
Signed-off-by: Tomtastisch <82227609+tomtastisch@users.noreply.github.com>
1 parent 5a71ed3 commit 4c82ee6

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/tag-gate.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Tag Gate
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
gate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
22+
with:
23+
dotnet-version: |
24+
8.0.x
25+
10.0.102
26+
27+
- name: Gate - validate tag format (stable/rc)
28+
shell: bash
29+
run: |
30+
set -euo pipefail
31+
TAG="${GITHUB_REF_NAME}"
32+
33+
STABLE_RE='^v[0-9]+\.[0-9]+\.[0-9]+$'
34+
RC_RE='^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[0-9]+$'
35+
36+
if [[ "$TAG" =~ $STABLE_RE ]]; then
37+
echo "OK: stable tag $TAG"
38+
elif [[ "$TAG" =~ $RC_RE ]]; then
39+
echo "OK: rc tag $TAG"
40+
else
41+
echo "FAIL: invalid tag format: $TAG" >&2
42+
exit 1
43+
fi
44+
45+
- name: Gate - derive tag outputs (SSOT)
46+
shell: bash
47+
env:
48+
RELEASE_TAG: ${{ github.ref_name }}
49+
run: bash tools/ci/release/derive_tag_outputs.sh
50+
51+
- name: Evidence
52+
shell: bash
53+
run: |
54+
set -euo pipefail
55+
mkdir -p artifacts/tag-gate
56+
printf '%s\n' "${GITHUB_REF_NAME}" > artifacts/tag-gate/tag.txt
57+
58+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
59+
if: always()
60+
with:
61+
name: tag-gate-evidence
62+
path: artifacts/tag-gate/
63+
if-no-files-found: error

0 commit comments

Comments
 (0)