From 5795da36a81b4fa236655498465e9f7cf7b87155 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Wed, 16 Oct 2024 21:47:49 +0200 Subject: [PATCH] feta(ci-cd): Add check for CI:CD git ref tag --- .github/workflows/release-nightly.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-nightly.yaml b/.github/workflows/release-nightly.yaml index 8c95f0f..44655e0 100644 --- a/.github/workflows/release-nightly.yaml +++ b/.github/workflows/release-nightly.yaml @@ -12,12 +12,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Check git version matches flake version + shell: bash + run: | + if ! [ $(${{ github.ref }} | cut -d'v' -f 2) = $(grep '# CI:CD-VERSION$' flake.nix | cut -d'"' -f 2) ]; + then + echo "Version mismatch between Git and flake" + exit 1 + fi + - name: Check version in code matches flake version shell: bash run: | if ! [ $(grep '// CI:CD-VERSION$' server/root-handler/handler.go | cut -d'"' -f 2) = $(grep '# CI:CD-VERSION$' flake.nix | cut -d'"' -f 2) ]; then - echo "Version mismatch" + echo "Version mismatch between code and flake" exit 1 fi