[CI] Add check for draft PRs (#5800)

* Add check for draft PRs

* Add necessary gitlab-ci boilerplate

* fix github API url (oops!)

* Add github action to retrigger pipeline

* fix workflow trigger

* rename trigger job

Co-authored-by: Benjamin Kampmann <ben@parity.io>
This commit is contained in:
s3krit
2020-04-28 17:55:09 +02:00
committed by GitHub
parent 986246a102
commit 2d73ccd65b
3 changed files with 43 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}"
echo "[+] API URL: $url"
draft_state=$(curl "$url" | jq -r .draft)
echo "[+] Draft state: $draft_state"
if [ "$draft_state" = 'true' ]; then
echo "[!] PR is currently a draft, stopping pipeline"
exit 1
else
echo "[+] PR is not a draft. Proceeding with CI pipeline"
exit 0
fi