Skip to content

Commit 504eb1a

Browse files
author
James Brundage
committed
Updating action (pulling just before push) (#163)
1 parent 6438897 commit 504eb1a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Github/Actions/PipeScriptAction.ps1

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,9 @@ if (-not $env:GITHUB_WORKSPACE) { throw "No GitHub workspace" }
122122

123123
$branchName = git rev-parse --abrev-ref HEAD
124124
if (-not $branchName) {
125-
126125
return
127126
}
128127

129-
git pull | Out-Host
130-
131128
$PipeScriptStart = [DateTime]::Now
132129
if ($PipeScript) {
133130
Invoke-PipeScript -Command $PipeScript |
@@ -163,11 +160,15 @@ if ($CommitMessage -or $anyFilesChanged) {
163160

164161
git commit -m $ExecutionContext.SessionState.InvokeCommand.ExpandString($CommitMessage)
165162
}
163+
164+
166165

167166
$checkDetached = git symbolic-ref -q HEAD
168167
if (-not $LASTEXITCODE) {
168+
"::notice::Pulling Changes" | Out-Host
169+
git pull | Out-Host
169170
"::notice::Pushing Changes" | Out-Host
170-
git push
171+
git push | Out-Host
171172
"Git Push Output: $($gitPushed | Out-String)"
172173
} else {
173174
"::notice::Not pushing changes (on detached head)" | Out-Host

0 commit comments

Comments
 (0)