Commit c213eb8a authored by Clement Bois's avatar Clement Bois Committed by Pierre Smeyers
Browse files

feat: use GITLAB_CI_LINT_TOKEN preferably to GITLAB_TOKEN

parent 84285d2d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@
    do
      log_info "Validating: $file..."
      cilint_req="{\"content\": $(jq --raw-input --slurp '.'  < "${file:-/dev/stdin}")}"
      cilint_resp=$(curl -s --header "Content-Type: application/json" --header "PRIVATE-TOKEN: $GITLAB_TOKEN" $CI_API_V4_URL/projects/$CI_PROJECT_ID/ci/lint --data "$cilint_req")
      cilint_resp=$(curl -s --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${GITLAB_TOKEN:-$GITLAB_CI_LINT_TOKEN}" $CI_API_V4_URL/projects/$CI_PROJECT_ID/ci/lint --data "$cilint_req")
      if [ "$(echo "$cilint_resp" | jq -r '.valid')" == "true" ]
      then
        log_info " ... valid"
@@ -224,8 +224,8 @@ gitlab-ci-lint:
  script:
    - ci_lint
  rules:
    # enabled if $GITLAB_TOKEN and GITLAB_CI_FILES are set
    - if: '($GITLAB_TOKEN != null && $GITLAB_TOKEN != "") && $GITLAB_CI_FILES'
    # enabled if GITLAB_TOKEN or GITLAB_CI_LINT_TOKEN and GITLAB_CI_FILES are set
    - if: '($GITLAB_TOKEN || $GITLAB_CI_LINT_TOKEN) && $GITLAB_CI_FILES'

check-links:
  extends: .gitlab-ci-base