Skip to content
Snippets Groups Projects
Commit 4e9a4c44 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'feat/auto-lint-on-feature-branches' into 'master'

feat: make lint job auto on feature branches

Closes #6

See merge request to-be-continuous/golang!8
parents 5cb9772a 88324d9d
No related branches found
No related tags found
No related merge requests found
......@@ -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).
......
......@@ -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",
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment