Skip to content

Commit

Permalink
Released kapp version can be used in github action (carvel-dev#193)
Browse files Browse the repository at this point in the history
Add a tag download validation to ensure that the version being
released is the retrieved
Start using the new github action
  • Loading branch information
joaopapereira authored Feb 18, 2021
1 parent cb94804 commit fc35325
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Checks after release is published
name: Checks after any release is published
on:
release:
types: ['published']
Expand All @@ -7,17 +7,18 @@ jobs:
validate-github-action:
runs-on: ubuntu-latest
steps:
- uses: k14s/setup-k14s-action@v1
- uses: vmware-tanzu/carvel-setup-action@v1
with:
only: kapp
kapp: ${{ github.event.release.tag_name }}
- run: |
kapp version
version=`kapp version`
tag="${{ github.event.release.tag_name }}"
tool_version="$(echo $version | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/')"
if [[ "v${tool_version}" == "${tag}" ]];
then
echo "Version match with latest"
echo "Version match with $tag"
exit 0
else
echo "Versions do not match v$tool_version != $tag"
Expand Down

0 comments on commit fc35325

Please sign in to comment.