Skip to content

Commit

Permalink
Update artifact CLI (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspin authored May 13, 2022
1 parent e6c484e commit 2c43f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Checkout.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function Initialize-Repository {

"pull-request" {
Write-Output "Initializing repository for pull-request..."
git clone --depth $env:SEMAPHORE_GIT_DEPTH $env:SEMAPHORE_GIT_URL $env:SEMAPHORE_GIT_DIR 2> $null
git clone --depth $env:SEMAPHORE_GIT_DEPTH $env:SEMAPHORE_GIT_URL $env:SEMAPHORE_GIT_DIR
Set-Location $env:SEMAPHORE_GIT_DIR
git fetch origin +${env:SEMAPHORE_GIT_REF}: 2> $null
git fetch origin +${env:SEMAPHORE_GIT_REF}:
if (-not $?) {
throw "Revision: $env:SEMAPHORE_GIT_SHA not found"
} else {
Expand All @@ -55,7 +55,7 @@ function Initialize-Repository {

"tag" {
Write-Output "Initializing repository for tag..."
git clone --depth $env:SEMAPHORE_GIT_DEPTH -b $env:SEMAPHORE_GIT_TAG_NAME $env:SEMAPHORE_GIT_URL $env:SEMAPHORE_GIT_DIR 2> $null
git clone --depth $env:SEMAPHORE_GIT_DEPTH -b $env:SEMAPHORE_GIT_TAG_NAME $env:SEMAPHORE_GIT_URL $env:SEMAPHORE_GIT_DIR
if (-not $?) {
throw "Release $env:SEMAPHORE_GIT_TAG_NAME not found"
} else {
Expand All @@ -80,18 +80,18 @@ function Initialize-ShallowRepository() {
git clone $env:SEMAPHORE_GIT_URL $env:SEMAPHORE_GIT_DIR
Set-Location $env:SEMAPHORE_GIT_DIR
if (Test-Revision) {
git reset --hard $env:SEMAPHORE_GIT_SHA 2> $null
git reset --hard $env:SEMAPHORE_GIT_SHA
} else {
throw "SHA: $env:SEMAPHORE_GIT_SHA not found"
}
} else {
Set-Location $env:SEMAPHORE_GIT_DIR
git reset --hard $env:SEMAPHORE_GIT_SHA 2> $null
git reset --hard $env:SEMAPHORE_GIT_SHA
if (-not $?) {
Write-Output "SHA: $env:SEMAPHORE_GIT_SHA not found, performing full clone"
git fetch --unshallow
if (Test-Revision) {
git reset --hard $env:SEMAPHORE_GIT_SHA 2> $null
git reset --hard $env:SEMAPHORE_GIT_SHA
} else {
throw "SHA: $env:SEMAPHORE_GIT_SHA not found"
}
Expand All @@ -100,7 +100,7 @@ function Initialize-ShallowRepository() {
}

function Test-Revision {
git rev-list HEAD..$env:SEMAPHORE_GIT_SHA 2> $null
git rev-list HEAD..$env:SEMAPHORE_GIT_SHA
if (-not $?) {
return $false
}
Expand Down
2 changes: 1 addition & 1 deletion release/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

ARTIFACT_CLI_VERSION="v0.5.2"
ARTIFACT_CLI_VERSION="v0.5.3"
WHEN_CLI_VERSION="v1.0.5"
SPC_CLI_VERSION="v1.9.2"
TEST_RESULTS_CLI_VERSION="v0.4.12"
Expand Down

0 comments on commit 2c43f24

Please sign in to comment.