Skip to content

Commit 2dbc6a8

Browse files
author
James Brundage
committed
Updating action (not running when there is not a current branch) (#158)
1 parent a1e9e58 commit 2dbc6a8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Github/Actions/PipeScriptAction.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ git config --global user.name $UserName
120120

121121
if (-not $env:GITHUB_WORKSPACE) { throw "No GitHub workspace" }
122122

123+
$branchName = git rev-parse --abrev-ref HEAD
124+
if (-not $branchName) {
125+
126+
return
127+
}
128+
123129
git pull | Out-Host
124130

125131
$PipeScriptStart = [DateTime]::Now

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ runs:
188188
189189
if (-not $env:GITHUB_WORKSPACE) { throw "No GitHub workspace" }
190190
191+
$branchName = git rev-parse --abrev-ref HEAD
192+
if (-not $branchName) {
193+
194+
return
195+
}
196+
191197
git pull | Out-Host
192198
193199
$PipeScriptStart = [DateTime]::Now

0 commit comments

Comments
 (0)