From e762957cc19e8c280e51e3a7cdf287f724de490e Mon Sep 17 00:00:00 2001 From: SylwiaBrant <45368349+SylwiaBrant@users.noreply.github.com> Date: Tue, 8 Jun 2021 09:38:47 +0200 Subject: [PATCH] Add security-validator branch to tests triggers --- .github/workflows/auto-tests.yaml | 2 ++ pkg/client/jenkins.go | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-tests.yaml b/.github/workflows/auto-tests.yaml index d4a99de9..f2638b29 100644 --- a/.github/workflows/auto-tests.yaml +++ b/.github/workflows/auto-tests.yaml @@ -3,10 +3,12 @@ on: push: branches: - master + - security-validator pull_request: types: [opened, synchronize, ready_for_review, reopened] branches: - master + - security-validator jobs: run-tests: if: github.event.pull_request.draft == false diff --git a/pkg/client/jenkins.go b/pkg/client/jenkins.go index 062c7a04..49c4923e 100644 --- a/pkg/client/jenkins.go +++ b/pkg/client/jenkins.go @@ -6,6 +6,7 @@ import ( "net/http/cookiejar" "regexp" "strings" + "time" "github.com/bndr/gojenkins" "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") } - httpClient := &http.Client{Jar: jar} + httpClient := &http.Client{ + Jar: jar, + Timeout: 10 * time.Second, + } if len(userName) > 0 && len(passwordOrToken) > 0 { basicAuth = &gojenkins.BasicAuth{Username: userName, Password: passwordOrToken}