Skip to content
Snippets Groups Projects

Add GitLab scanning, linting

Merged Erick Hitter requested to merge add/gl-tools into main
6 files
+ 73
1
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 31
0
#!/bin/bash
jq --null-input --arg yaml "$1" '.content=$yaml' \
| curl "https://git.ethitter.com/api/v4/ci/lint?include_merged_yaml=true" \
--silent \
--header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: $GITLAB_API_PAT" \
--data @- \
-o result.json
echo "**********************************************************"
echo "MERGED YAML:"
jq --raw-output '.merged_yaml' < result.json
echo "**********************************************************"
echo "ERRORS:"
jq '.errors' < result.json
echo "**********************************************************"
echo "WARNINGS:"
jq '.warnings' < result.json
echo "**********************************************************"
echo "IS VALID:"
jq '.valid' < result.json
if [ "$(jq '.valid' < result.json)" = "true" ]; then
exit 0
else
exit 1
fi
Loading