Commit 7c0b1df2 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(ci-lint): ci-lint API changes

parent 837007e1
Loading
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -32,13 +32,14 @@
    for file in $(eval "ls -1 $GITLAB_CI_FILES")
    do
      log_info "Validating: $file..."
      REQUEST="{\"content\": $(jq --raw-input --slurp '.'  < "${file:-/dev/stdin}")}"
      RESULT=$(curl -s --header "Content-Type: application/json" --header "PRIVATE-TOKEN: $GITLAB_TOKEN" $CI_API_V4_URL/ci/lint --data "$REQUEST")
      if [ "$(echo "$RESULT" |  jq '.status')" == "\"valid\"" ]
      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")
      if [ "$(echo "$cilint_resp" | jq -r '.valid')" == "true" ]
      then
        log_info " ... valid ($RESULT)"
        log_info " ... valid"
      else
        log_error " ... invalid: $RESULT"
        log_error " ... invalid"
        echo "$cilint_resp" | jq -r '.errors[]'
        rc=1
      fi
    done