mirror of
https://github.com/vbatts/git-validation.git
synced 2025-01-16 00:30:09 +00:00
Merge pull request #15 from vbatts/fix_range_var
main: default travis commit range is unreliable
This commit is contained in:
commit
a23edf13d9
2 changed files with 10 additions and 4 deletions
10
.travis.yml
10
.travis.yml
|
@ -10,11 +10,17 @@ before_install:
|
||||||
- go get -u github.com/golang/lint/golint
|
- go get -u github.com/golang/lint/golint
|
||||||
- mkdir -p $GOPATH/src/github.com/vbatts && ln -sf $(pwd) $GOPATH/src/github.com/vbatts/git-validation && go get ./...
|
- mkdir -p $GOPATH/src/github.com/vbatts && ln -sf $(pwd) $GOPATH/src/github.com/vbatts/git-validation && go get ./...
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- echo $TRAVIS_COMMIT
|
||||||
|
- echo $TRAVIS_BRANCH
|
||||||
|
- echo $TRAVIS_TAG
|
||||||
|
- echo $TRAVIS_BUILD_NUMBER
|
||||||
|
- echo $TRAVIS_REPO_SLUG
|
||||||
|
|
||||||
install: true
|
install: true
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- go vet -x ./...
|
- go vet -x ./...
|
||||||
- golint ./...
|
- golint ./...
|
||||||
- go build .
|
- go build .
|
||||||
- go test -v ./...
|
- go test -v ./...
|
||||||
|
|
4
main.go
4
main.go
|
@ -50,8 +50,8 @@ func main() {
|
||||||
var commitRange = *flCommitRange
|
var commitRange = *flCommitRange
|
||||||
if commitRange == "" {
|
if commitRange == "" {
|
||||||
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
|
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
|
||||||
if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
|
if os.Getenv("TRAVIS_BRANCH") != "" {
|
||||||
commitRange = os.Getenv("TRAVIS_COMMIT_RANGE")
|
commitRange = fmt.Sprintf("%s..FETCH_HEAD", os.Getenv("TRAVIS_BRANCH"))
|
||||||
} else if os.Getenv("TRAVIS_COMMIT") != "" {
|
} else if os.Getenv("TRAVIS_COMMIT") != "" {
|
||||||
commitRange = os.Getenv("TRAVIS_COMMIT")
|
commitRange = os.Getenv("TRAVIS_COMMIT")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue