Unverified Commit c4de228e authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #19630 from karalabe/fix-commit-strings

internal/build: fix Travis and AppVeyor commit string injection
parents f8a4e379 f0bced30
...@@ -57,7 +57,7 @@ func Env() Environment { ...@@ -57,7 +57,7 @@ func Env() Environment {
case os.Getenv("CI") == "true" && os.Getenv("TRAVIS") == "true": case os.Getenv("CI") == "true" && os.Getenv("TRAVIS") == "true":
commit := os.Getenv("TRAVIS_PULL_REQUEST_SHA") commit := os.Getenv("TRAVIS_PULL_REQUEST_SHA")
if commit == "" { if commit == "" {
os.Getenv("TRAVIS_COMMIT") commit = os.Getenv("TRAVIS_COMMIT")
} }
return Environment{ return Environment{
Name: "travis", Name: "travis",
...@@ -73,7 +73,7 @@ func Env() Environment { ...@@ -73,7 +73,7 @@ func Env() Environment {
case os.Getenv("CI") == "True" && os.Getenv("APPVEYOR") == "True": case os.Getenv("CI") == "True" && os.Getenv("APPVEYOR") == "True":
commit := os.Getenv("APPVEYOR_PULL_REQUEST_HEAD_COMMIT") commit := os.Getenv("APPVEYOR_PULL_REQUEST_HEAD_COMMIT")
if commit == "" { if commit == "" {
os.Getenv("APPVEYOR_REPO_COMMIT") commit = os.Getenv("APPVEYOR_REPO_COMMIT")
} }
return Environment{ return Environment{
Name: "appveyor", Name: "appveyor",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment