Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Infra
CI Jobs
Official Devices Validator
Commits
6ea34e85
Commit
6ea34e85
authored
Aug 27, 2020
by
José Henrique
Browse files
Be more direct when user tries to skip ci
Also dont close pr, that isn't needed
parent
21640e5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
runner.sh
View file @
6ea34e85
...
...
@@ -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."
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment