-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing 'path' parameter from 'git log' command #118
Merged
RamblingCookieMonster
merged 2 commits into
RamblingCookieMonster:master
from
raandree:master
Sep 19, 2019
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,21 +160,21 @@ function Get-BuildVariable { | |
'CI_COMMIT_SHA' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # Gitlab 9.0+ - thanks to mipadi http://stackoverflow.com/a/3357357/3067642 | ||
} | ||
'CI_BUILD_REF' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # Gitlab 8.x - thanks to mipadi http://stackoverflow.com/a/3357357/3067642 | ||
} | ||
'GIT_COMMIT' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # Jenkins - thanks to mipadi http://stackoverflow.com/a/3357357/3067642 | ||
} | ||
|
@@ -186,21 +186,21 @@ function Get-BuildVariable { | |
'SYSTEM_DEFAULTWORKINGDIRECTORY' { #Azure Pipelines, this will be triggered in the case of a classic release pipeline | ||
if($WeCanGit) | ||
{ | ||
(Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )").split([Environment]::NewLine,[System.StringSplitOptions]::RemoveEmptyEntries) -join " " | ||
(Invoke-Git @IGParams -Arguments "log --format=%B -n 1").split([Environment]::NewLine,[System.StringSplitOptions]::RemoveEmptyEntries) -join " " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this one is weird. It should be a commit sha, not a path, not sure what happened. |
||
break | ||
} # Azure Pipelines Classic Release (https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables) | ||
} | ||
'BUILD_VCS_NUMBER' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # Teamcity https://confluence.jetbrains.com/display/TCD10/Predefined+Build+Parameters | ||
} | ||
'BAMBOO_REPOSITORY_REVISION_NUMBER' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # Bamboo https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html | ||
} | ||
|
@@ -211,7 +211,7 @@ function Get-BuildVariable { | |
'GITHUB_SHA' { | ||
if($WeCanGit) | ||
{ | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1 $( (Get-Item -Path "ENV:$_").Value )" | ||
Invoke-Git @IGParams -Arguments "log --format=%B -n 1" | ||
break | ||
} # GitHub Actions https://developer.github.com/actions/creating-github-actions/accessing-the-runtime-environment/#environment-variables | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So! In this section (getting commit message), the deleted bit is the commit sha. If you leave this off, AFAICT it will get the current commit. Potential corner case: Someone has been moving around in their build (checking out a different commit), but still want to refer to the commit message of the build's commit.
Do these lines ever error out for you? Maybe I'm grabbing a wrong environment variable? Intention in this section is to grab commit to do this: https://stackoverflow.com/a/3357357