diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml index 22249417..3e8fd46d 100644 --- a/.github/workflows/release_draft.yml +++ b/.github/workflows/release_draft.yml @@ -43,40 +43,40 @@ jobs: } tag-name: ${{ github.event.inputs.tag-name }} - - name: Check tag's correct version increment - uses: actions/github-script@v7 - with: - script: | - const newTag = core.getInput('tag-name'); - - // get latest tag - const { data: refs } = await github.rest.git.listMatchingRefs({ - owner: context.repo.owner, - repo: context.repo.repo, - ref: 'tags/' - }); - - if (refs.length === 0) { - // No existing tags, so any new tag is valid - console.log('No existing tags found. Any new tag is considered valid.'); - return; - } - - const latestTag = refs.sort((a, b) => new Date(b.object.date) - new Date(a.object.date))[0].ref.replace('refs/tags/', ''); - const latestVersion = latestTag.replace('v', '').split('.').map(Number); - const newVersion = newTag.replace('v', '').split('.').map(Number); - - // check tag's correct version increase - const isValid = (latestVersion[0] === newVersion[0] && latestVersion[1] === newVersion[1] && newVersion[2] === latestVersion[2] + 1) || - (latestVersion[0] === newVersion[0] && newVersion[1] === latestVersion[1] + 1 && newVersion[2] === 0) || - (newVersion[0] === latestVersion[0] + 1 && newVersion[1] === 0 && newVersion[2] === 0); - - if (!isValid) { - core.setFailed('New tag is not one version higher than the latest tag'); - return; - } - - tag-name: ${{ github.event.inputs.tag-name }} +# - name: Check tag's correct version increment +# uses: actions/github-script@v7 +# with: +# script: | +# const newTag = core.getInput('tag-name'); +# +# // get latest tag +# const { data: refs } = await github.rest.git.listMatchingRefs({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# ref: 'tags/' +# }); +# +# if (refs.length === 0) { +# // No existing tags, so any new tag is valid +# console.log('No existing tags found. Any new tag is considered valid.'); +# return; +# } +# +# const latestTag = refs.sort((a, b) => new Date(b.object.date) - new Date(a.object.date))[0].ref.replace('refs/tags/', ''); +# const latestVersion = latestTag.replace('v', '').split('.').map(Number); +# const newVersion = newTag.replace('v', '').split('.').map(Number); +# +# // check tag's correct version increase +# const isValid = (latestVersion[0] === newVersion[0] && latestVersion[1] === newVersion[1] && newVersion[2] === latestVersion[2] + 1) || +# (latestVersion[0] === newVersion[0] && newVersion[1] === latestVersion[1] + 1 && newVersion[2] === 0) || +# (newVersion[0] === latestVersion[0] + 1 && newVersion[1] === 0 && newVersion[2] === 0); +# +# if (!isValid) { +# core.setFailed('New tag is not one version higher than the latest tag'); +# return; +# } +# +# tag-name: ${{ github.event.inputs.tag-name }} release-draft: needs: check-tag