Add security-validator branch to tests triggers

This commit is contained in:
SylwiaBrant 2021-06-08 09:38:47 +02:00 committed by GitHub
parent 38fcdf5d37
commit e762957cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -3,10 +3,12 @@ on:
push: push:
branches: branches:
- master - master
- security-validator
pull_request: pull_request:
types: [opened, synchronize, ready_for_review, reopened] types: [opened, synchronize, ready_for_review, reopened]
branches: branches:
- master - master
- security-validator
jobs: jobs:
run-tests: run-tests:
if: github.event.pull_request.draft == false if: github.event.pull_request.draft == false

View File

@ -6,6 +6,7 @@ import (
"net/http/cookiejar" "net/http/cookiejar"
"regexp" "regexp"
"strings" "strings"
"time"
"github.com/bndr/gojenkins" "github.com/bndr/gojenkins"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -156,7 +157,10 @@ func newClient(url, userName, passwordOrToken string) (Jenkins, error) {
return nil, errors.Wrap(err, "couldn't create a cookie jar") return nil, errors.Wrap(err, "couldn't create a cookie jar")
} }
httpClient := &http.Client{Jar: jar} httpClient := &http.Client{
Jar: jar,
Timeout: 10 * time.Second,
}
if len(userName) > 0 && len(passwordOrToken) > 0 { if len(userName) > 0 && len(passwordOrToken) > 0 {
basicAuth = &gojenkins.BasicAuth{Username: userName, Password: passwordOrToken} basicAuth = &gojenkins.BasicAuth{Username: userName, Password: passwordOrToken}