Skip to content

Commit 737b868

Browse files
committed
feat: validate snapshot for snapshot workflow
Signed-off-by: Adrien Mannocci <[email protected]>
1 parent e4ad2b3 commit 737b868

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/snapshot.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,29 @@ permissions:
1616
contents: read
1717

1818
jobs:
19+
validate:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
is-snapshot: ${{ steps.validate-step.outputs.is-snapshot }}
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
- name: Validate version is a snapshot version
27+
id: validate-step
28+
run: |
29+
output=false
30+
if [[ "$(./mvnw -q help:evaluate -Dexpression=project.version -DforceStdout)" =~ "-SNAPSHOT" ]]; then
31+
echo "This is a snapshot version"
32+
output=true
33+
fi
34+
echo "is-snapshot=${output}" >> "$GITHUB_OUTPUT"
35+
1936
deploy:
2037
name: Deploy
2138
runs-on: ubuntu-latest
22-
39+
needs:
40+
- validate
41+
if: ${{ contains(needs.validate.outputs.is-snapshot, 'true') }}
2342
steps:
2443
- id: buildkite
2544
name: Run Deploy

0 commit comments

Comments
 (0)