Skip to content

Commit

Permalink
ci(snapshot): skip deploy if no snapshot version
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Feb 19, 2024
1 parent 06ca554 commit 0cc7e1d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0cc7e1d

Please sign in to comment.