From 352d4bc1b8d98891915fd5fbb5be4753bf670334 Mon Sep 17 00:00:00 2001 From: jterryons <57897360+jterryons@users.noreply.github.com> Date: Thu, 17 Dec 2020 16:06:20 +0000 Subject: [PATCH] add key value support for /deploy command (#225) --- .github/workflows/comment.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/comment.yml b/.github/workflows/comment.yml index 872bf7a9b..12b6ce652 100644 --- a/.github/workflows/comment.yml +++ b/.github/workflows/comment.yml @@ -20,6 +20,12 @@ jobs: COMMENT_BODY: ${{ github.event.comment.body }} run: | echo NAMESPACE=$(echo $COMMENT_BODY | cut -d' ' -f2) >> $GITHUB_ENV + PARAM_KV_PAIR=$(echo $COMMENT_BODY | cut -d' ' -f3) + IFS='=' + arrIN=($PARAM_KV_PAIR) + echo PARAM_KEY=${arrIN[0]} >> $GITHUB_ENV + echo PARAM_VALUE=${arrIN[1]} >> $GITHUB_ENV + unset IFS - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master with: @@ -40,5 +46,5 @@ jobs: - name: Trigger spinnaker run: | gcloud pubsub topics publish $SPINNAKER_TOPIC --project $HOST \ - --message "{ \"kind\": \"storage#object\", \"name\": \"$IMAGE/$IMAGE-latest.tgz\", \"bucket\": \"$ARTIFACT_BUCKET\", \"parameters\": { \"tag\": \"pr-${{ github.event.issue.number }}\", \"namespace\": \"${{ env.NAMESPACE }}\", \"cluster\": \"dev\", \"actor\": \"$GITHUB_ACTOR\" } }" \ + --message "{ \"kind\": \"storage#object\", \"name\": \"$IMAGE/$IMAGE-latest.tgz\", \"bucket\": \"$ARTIFACT_BUCKET\", \"parameters\": { \"tag\": \"pr-${{ github.event.issue.number }}\", \"namespace\": \"${{ env.NAMESPACE }}\", \"cluster\": \"dev\", \"actor\": \"$GITHUB_ACTOR\", \"paramKey\": \"PARAM_KEY\", \"paramValue\": \"$PARAM_VALUE\" } }" \ --attribute ci="actions"