Skip to content

Commit

Permalink
Fail creating release if tag already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinsoftware committed May 19, 2020
1 parent 312de77 commit 1d8b041
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -38,6 +38,7 @@ RUN pwsh /app/release.ps1 -create_release -version 100
RUN pwsh /app/release.ps1 -mark_released -version 100

RUN pwsh /app/assertOutput.ps1 "git diff origin/master...origin/develop" "" -assertExactMatch -assertPass
RUN pwsh /app/assertOutput.ps1 "pwsh /app/release.ps1 -create_release -version 100" -assertFail

RUN git log --all --graph --decorate

Expand Down
3 changes: 3 additions & 0 deletions release.ps1
Expand Up @@ -161,6 +161,9 @@ if ($create_release) {
}
$branch_name = GetBranchName $version

if (DoesRefExist "refs/tags/v$version") {
throw "Tag $version already exists on remote, please delete it and try again"
}
if (DoesRefExist "refs/remotes/origin/$branch_name") {
throw "Branch $branch_name already exists on remote, please delete it and try again"
}
Expand Down

0 comments on commit 1d8b041

Please sign in to comment.