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 @@ ...@@ -32,13 +32,14 @@
for file in $(eval "ls -1 $GITLAB_CI_FILES") for file in $(eval "ls -1 $GITLAB_CI_FILES")
do do
log_info "Validating: $file..." log_info "Validating: $file..."
REQUEST="{\"content\": $(jq --raw-input --slurp '.' < "${file:-/dev/stdin}")}" cilint_req="{\"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") 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 "$RESULT" | jq '.status')" == "\"valid\"" ] if [ "$(echo "$cilint_resp" | jq -r '.valid')" == "true" ]
then then
log_info " ... valid ($RESULT)" log_info " ... valid"
else else
log_error " ... invalid: $RESULT" log_error " ... invalid"
echo "$cilint_resp" | jq -r '.errors[]'
rc=1 rc=1
fi fi
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment