Skip to content

Commit

Permalink
cflzally.sh script now comments a thumbs-up emoji when commit looks g…
Browse files Browse the repository at this point in the history
…ood (2nd attempt)
  • Loading branch information
Robert James Oxspring committed Feb 22, 2018
1 parent 98c2b74 commit 7074ac7
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions cli/zally/cflzally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,29 @@ if /usr/bin/jq --exit-status ".violations | length > 0" /tmp/zally.json; then
"$JSONTOMARKDOWN" \
/tmp/zally.json > /tmp/zally.md
/bin/sed -e s/^/\ \ /g /tmp/zally.md

echo "Commenting violations on gitlab commit..."
/usr/bin/curl \
--silent \
--request POST \
--header "PRIVATE-TOKEN: ${ZALLY_GITLAB_TOKEN}" \
--form "note=</tmp/zally.md" \
--form "path=$PATH" \
--form "line=1" \
--form "line_type=new" \
${CI_PROJECT_URL}/../../api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_BUILD_REF}/comments

else
/bin/echo -e "\U0001F44D" > /tmp/zally.md
echo "Commenting success on gitlab commit..."
/usr/bin/curl \
--silent \
--request POST \
--header "PRIVATE-TOKEN: ${ZALLY_GITLAB_TOKEN}" \
--data "note=%F0%9F%91%8D" \
--data "path=$PATH" \
--data "line=1" \
--data "line_type=new" \
${CI_PROJECT_URL}/../../api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_BUILD_REF}/comments
fi

echo "Commenting on gitlab commit..."
/usr/bin/curl \
--silent \
--request POST \
--header "PRIVATE-TOKEN: ${ZALLY_GITLAB_TOKEN}" \
--form "note=</tmp/zally.md" \
--form "path=$PATH" \
--form "line=1" \
--form "line_type=new" \
${CI_PROJECT_URL}/../../api/v4/projects/${CI_PROJECT_ID}/repository/commits/${CI_BUILD_REF}/comments

exit $RESULT

0 comments on commit 7074ac7

Please sign in to comment.