Skip to content

Commit

Permalink
Automate checking there is no published release using the version alr…
Browse files Browse the repository at this point in the history
…eady (#3865)

Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy authored Nov 11, 2023
1 parent 625753c commit 9efc0ac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down

0 comments on commit 9efc0ac

Please sign in to comment.