-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate checking there is no published release using the version alr…
…eady (#3865) Signed-off-by: Michael Telatynski <[email protected]>
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,21 @@ jobs: | |
if: inputs.mode == 'final' | ||
run: echo "VERSION=$(echo $VERSION | cut -d- -f1)" >> $GITHUB_ENV | ||
|
||
- name: Check version number not in use | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { VERSION } = process.env; | ||
github.rest.repos.getReleaseByTag({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag: VERSION, | ||
}).then(() => { | ||
core.setFailed(`Version ${VERSION} already exists`); | ||
}).catch(() => { | ||
// This is fine, we expect there to not be any release with this version yet | ||
}); | ||
- name: Set up git | ||
run: | | ||
git config --global user.email "[email protected]" | ||
|