From 0cc7e1d4de85b3877a676a03922e89f00a4d86b7 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 19 Feb 2024 15:04:27 +0100 Subject: [PATCH] ci(snapshot): skip deploy if no snapshot version --- .github/workflows/snapshot.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 26eaa79..0d3ca7c 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -13,10 +13,27 @@ on: type: boolean jobs: + validate: + runs-on: ubuntu-latest + outputs: + is-snapshot: ${{ steps.validate.outputs.is-snapshot }} + steps: + - uses: actions/checkout@v4 + - name: Validate version is a snapshot version + id: validate + run: | + output=false + if [[ "$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout)" =~ "-SNAPSHOT" ]]; then + echo "This is a snapshot version" + output=true + fi + echo "is-snapshot=$output" >> "$GITHUB_OUTPUT" + deploy: name: Deploy runs-on: ubuntu-latest - + needs: validate + if: ${{ needs.validate.outputs.is-snapshot == true}} steps: - id: buildkite name: Run Deploy