Skip to content

Commit

Permalink
feat: validate snapshot for snapshot workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Adrien Mannocci <[email protected]>
  • Loading branch information
amannocci committed Mar 25, 2024
1 parent e4ad2b3 commit 737b868
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,29 @@ permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
outputs:
is-snapshot: ${{ steps.validate-step.outputs.is-snapshot }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate version is a snapshot version
id: validate-step
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: ${{ contains(needs.validate.outputs.is-snapshot, 'true') }}
steps:
- id: buildkite
name: Run Deploy
Expand Down

0 comments on commit 737b868

Please sign in to comment.