Commit 88324d9d authored by Yann D'Isanto's avatar Yann D'Isanto Committed by Pierre Smeyers
Browse files

feat: make lint job auto on feature branches

parent 5cb9772a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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).

+1 −0
Original line number Diff line number Diff line
@@ -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",
+5 −2
Original line number Diff line number Diff line
@@ -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: