diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index a56c111..336f06e 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -167,19 +167,24 @@ jobs: with: script: | const latestReleaseTag = process.env.LATEST_RELEASE_TAG; + if (latestReleaseTag.length === 0) { + throw new Error("LATEST_RELEASE_TAG is empty!"); + } - if (latestReleaseTag.length > 0) { - const incrementReleaseTag = latestReleaseTag.replace(/(\d+)([^\.]*)$/, (_, x, y) => (Number(x) + 1) + y); + const incrementReleaseTag = latestReleaseTag.replace(/(\d+)([^\.]*)$/, (_, x, y) => (Number(x) + 1) + y); + if (latestReleaseTag === incrementReleaseTag) { + throw new Error("Tag increment failed! (proposed tag matches LATEST_RELEASE_TAG)"); + } - if (incrementReleaseTag.length >= latestReleaseTag.length && latestReleaseTag !== incrementReleaseTag) { - return incrementReleaseTag; - } + if (incrementReleaseTag.length < latestReleaseTag.length) { + throw new Error(`Tag increment failed! (proposed tag ${incrementReleaseTag} is shorter than ${latestReleaseTag}`); } + return incrementReleaseTag; + - name: Tag Release env: NEW_RELEASE_TAG: ${{ fromJson(steps.increment-tag.outputs.result) }} - if: ${{ env.LATEST_RELEASE_TAG != '' && env.LATEST_RELEASE_TAG != '""' }} run: | git tag "$NEW_RELEASE_TAG"; git push origin tag "$NEW_RELEASE_TAG"; diff --git a/make-release b/make-release index 1e76608..659d30e 100755 --- a/make-release +++ b/make-release @@ -1,6 +1,5 @@ #!/bin/sh set -euC; -#test6 RELEASE_DIR="release/";