Commit 6ea34e85 authored by José Henrique's avatar José Henrique
Browse files

Be more direct when user tries to skip ci

Also dont close pr, that isn't needed
parent 21640e5e
......@@ -21,10 +21,6 @@ function commentPR() {
curl -s -X POST -d "{\"body\": \"$message\"}" -H "Authorization: token $GH_PERSONAL_TOKEN" "https://api.github.com/repos/PixelExperience/official_devices/issues/$GIT_PR_NUMBER/comments" >/dev/null
}
function closePR() {
curl -s -X POST -d '{"state": "closed"}' -H "Authorization: token $GH_PERSONAL_TOKEN" "https://api.github.com/repos/PixelExperience/official_devices/pulls/$GIT_PR_NUMBER" >/dev/null
}
function approvePR() {
curl -s -X POST -d "{\"commit_id\": \"${COMMIT_HASH}\", \"event\": \"APPROVE\"}" -H "Authorization: token $GH_PERSONAL_TOKEN" "https://api.github.com/repos/PixelExperience/official_devices/pulls/$GIT_PR_NUMBER/reviews" >/dev/null
}
......@@ -32,8 +28,7 @@ function approvePR() {
function checkLint() {
if [[ "$COMMIT_MESSAGE" =~ "[PIXEL-CI]" ]]; then
if [[ -n "$GIT_PR_NUMBER" ]]; then
commentPR "This is Pixel CI Automation Service! You attempted to skip CI on a PR, its not permitted. Reopen PR after you fix the commit message."
closePR
commentPR "Please remove \"[PIXEL-CI]\" from your commit message."
exit 0
else
echo "Commit already linted, nothing to do."
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment