Skip to content

Commit 04f5600

Browse files
committed
Check if automerge label is set
1 parent 3ef88ac commit 04f5600

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

.circleci/config.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,8 @@ jobs:
162162
if [ "${CIRCLE_BRANCH}" != "master" ]; then
163163
PR_URL="$CIRCLE_PULL_REQUEST"
164164
PR_NUMBER=$(echo $PR_URL | awk -F'/' '{print $NF}')
165-
IS_DRAFT=$(curl "https://api.github.com/repos/scalableminds/webknossos/pulls/${PR_NUMBER}" | jq '.draft')
166-
if [ "$IS_DRAFT" == "true" ]; then
167-
echo "PR is a draft, not installing dev deployment"
168-
else
165+
SHOULD_AUTOMERGE=$(curl "https://api.github.com/repos/scalableminds/webknossos/pulls/${PR_NUMBER}" | jq -e '.labels | .[] | select(.name == "autodeploy")')
166+
if [ "$SHOULD_AUTOMERGE" == "true" ]; then
169167
curl -X POST -H "X-Auth-Token: $RELEASE_API_TOKEN" "https://kubernetix.scm.io/hooks/install/webknossos/dev/${CIRCLE_BRANCH}?user=CI+%28nightly%29"
170168
echo "\nInstalled to $NORMALIZED_BRANCH.webknossos.xyz"
171169
fi

0 commit comments

Comments
 (0)