diff --git a/README.md b/README.md index 706be140937fd9806f1c6f43f4c558596234221b..44182d5f2716a336d1be7e65845146358a417ab3 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ It is bound to the `build` stage, and uses the following variables: | --------------------- | -------------------------------------------- | ----------------- | | `GO_CI_LINT_IMAGE` | The Docker image used to run `golangci-lint` | `golangci/golangci-lint:latest-alpine` | | `GO_CI_LINT_ARGS` | `golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options) | `-E gosec,goimports ./...` | +| `GO_CI_LINT_DISABLED` | Set to `true` to disable this job | _none_(enabled) | Golang Security Checker can be a long operation and therefore the job is configured to be ran **manually** by default (overridable). diff --git a/kicker.json b/kicker.json index be374c951a9c9fb05e5f24d87860808ad1fff36c..95a0387daa6d05d3d80734b3dde4a32730b1a5fa 100644 --- a/kicker.json +++ b/kicker.json @@ -43,6 +43,7 @@ "id": "golangci-lint", "name": "GolangCI-Lint", "description": "[GolangCI-Lint](https://github.com/golangci/golangci-lint) analysis", + "disable_with": "GO_CI_LINT_DISABLED", "variables": [ { "name": "GO_CI_LINT_IMAGE", diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml index 29d928fd71abdd309e667a69c0c00eb659e35d1b..2121ec6603d57f64ef8183bf45f1f78ceb37ec2e 100644 --- a/templates/gitlab-ci-golang.yml +++ b/templates/gitlab-ci-golang.yml @@ -358,10 +358,13 @@ go-ci-lint: # exclude merge requests - if: $CI_MERGE_REQUEST_ID when: never + # exclude if GO_CI_LINT_DISABLED set + - if: '$GO_CI_LINT_DISABLED == "true"' + when: never # on production or integration branches: auto - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF' - # else (development branches): manual & non-blocking - - when: manual + # else (development branches): non-blocking + - if: $CI_COMMIT_REF_NAME # useless but prevents GitLab from warning allow_failure: true go-mod-outdated: