From 609e4fe6da64f22399d8760f1d17700ae85fc7d3 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 7 Nov 2023 23:24:44 +0100 Subject: [PATCH] feat: pre-check for git tag and project version --- .github/workflows/release.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f72540d..8e6a152 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,22 @@ on: push: tags: - 'v[0-9]+.[0-9]+.[0-9]+' - + jobs: + pre-check: + name: Pre-check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: | + if [[ "$(git describe --tags --abbrev=0)" != "v$(grep -m1 -F 'version =' Cargo.toml | cut -d\" -f2)" ]]; then + echo "Error: The git tag does not match the Cargo.toml version." + exit 1 + fi + echo "Success: The git tag matches the Cargo.toml version." + build: + needs: pre-check strategy: matrix: name: