From 04f5600555aa611db8eae54c6ecb0284aab1f2a6 Mon Sep 17 00:00:00 2001 From: frcroth Date: Mon, 18 Mar 2024 10:21:18 +0100 Subject: [PATCH] Check if automerge label is set --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dac0be7ab22..cf472ab8b37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -162,10 +162,8 @@ jobs: if [ "${CIRCLE_BRANCH}" != "master" ]; then PR_URL="$CIRCLE_PULL_REQUEST" PR_NUMBER=$(echo $PR_URL | awk -F'/' '{print $NF}') - IS_DRAFT=$(curl "https://api.github.com/repos/scalableminds/webknossos/pulls/${PR_NUMBER}" | jq '.draft') - if [ "$IS_DRAFT" == "true" ]; then - echo "PR is a draft, not installing dev deployment" - else + SHOULD_AUTOMERGE=$(curl "https://api.github.com/repos/scalableminds/webknossos/pulls/${PR_NUMBER}" | jq -e '.labels | .[] | select(.name == "autodeploy")') + if [ "$SHOULD_AUTOMERGE" == "true" ]; then curl -X POST -H "X-Auth-Token: $RELEASE_API_TOKEN" "https://kubernetix.scm.io/hooks/install/webknossos/dev/${CIRCLE_BRANCH}?user=CI+%28nightly%29" echo "\nInstalled to $NORMALIZED_BRANCH.webknossos.xyz" fi