Cancel release if version was already released
This commit is contained in:
1 parent
2af067c26d
commit
027d7f5808
1 file changed
+16
@@ -41,6 +41,22 @@ jobs:
|
|||||||
if ! ${{ steps.properties.outputs.release-extra-branch }}; then
|
if ! ${{ steps.properties.outputs.release-extra-branch }}; then
|
||||||
echo "matrix-to-exclude=Snapshots" >> $GITHUB_OUTPUT
|
echo "matrix-to-exclude=Snapshots" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
- uses: actions/github-script@v6
|
||||||
|
env:
|
||||||
|
READ_VERSION: ${{ steps.properties.outputs.mod_version }}
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { READ_VERSION } = process.env;
|
||||||
|
console.log('Read version is: ' + READ_VERSION);
|
||||||
|
let releases = (await github.rest.repos.listReleases({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo
|
||||||
|
})).data;
|
||||||
|
console.log('Previous release was: ' + releases[1].name);
|
||||||
|
for (let release of releases.slice(1)) {
|
||||||
|
if (release.name.includes(READ_VERSION))
|
||||||
|
core.setFailed('Version number is the same as a previous release!')
|
||||||
|
}
|
||||||
Build-And-Publish:
|
Build-And-Publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [Get-Properties]
|
needs: [Get-Properties]
|
||||||
|
|||||||
Reference in new issue
Block a user