Update update_latest.yml per review comments.
@@ -15,7 +15,7 @@ on:
jobs:
info:
- name: Validate Input Version
+ name: Validate Git Tag
runs-on: ubuntu-latest
steps:
- name: Get Version
@@ -29,7 +29,7 @@ jobs:
echo "::set-output name=tag::${{ steps.version.outputs.version-without-v }}"
fi
- - name: Version/Tag Outputs
+ - name: Echo Outputs
run: |
echo "version=\"${{ steps.version.outputs.version }}\""
echo "major=\"${{ steps.version.outputs.major }}\""
@@ -40,6 +40,14 @@ jobs:
echo "is-semver=\"${{ steps.version.outputs.is-semver }}\""
echo "tag=\"${{ steps.tag.outputs.tag }}\""
+ - name: Check Tag
+ run: |
+ if [[ ${{needs.info.outputs.tag}} == '' || ${{needs.info.outputs.prerelease}} != '' ]]; then
+ echo "The git version ${{ steps.version.outputs.version }} is not usable..."
+ echo " It must start with a v, be a valid semantic version, and not be a prerelease"
+ exit 1
+ fi
+
outputs:
prerelease: ${{ steps.version.outputs.prerelease }}
tag: ${{ steps.tag.outputs.tag }}
@@ -48,7 +56,6 @@ jobs:
name: Update CDN Latest
runs-on: ubuntu-latest
needs: info
- if: ${{ needs.info.outputs.tag != '' && needs.info.outputs.prerelease == '' }}
steps:
- name: Update dl/scope/latest
env:
@@ -73,7 +80,6 @@ jobs:
name: Update Latest Tag in Dockerhub
runs-on: ubuntu-latest
needs: [info,update-cdn-latest]
- if: ${{ needs.info.outputs.tag != '' && needs.info.outputs.prerelease == '' }}
steps:
- name: Login to Dockerhub
uses: docker/login-action@v2
