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

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

parent 837007e1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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