From 3455167792c8a14a8043b578c6018b9a5dc05b88 Mon Sep 17 00:00:00 2001 From: Harikrishnan Balagopal Date: Tue, 10 Oct 2023 14:26:20 +0530 Subject: [PATCH] ci: fix the github script in raise pr workflow to produce channel name output correctly Signed-off-by: Harikrishnan Balagopal --- .github/workflows/raise-operator-pr.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/raise-operator-pr.yml b/.github/workflows/raise-operator-pr.yml index 0eb5d67..b6b7259 100644 --- a/.github/workflows/raise-operator-pr.yml +++ b/.github/workflows/raise-operator-pr.yml @@ -26,20 +26,17 @@ jobs: echo "installing yq..." curl -L https://github.com/mikefarah/yq/releases/download/v4.13.5/yq_linux_amd64 -o /usr/local/bin/yq && chmod +x /usr/local/bin/yq echo "yq installed" - - name: get_channel - uses: actions/github-script@v3 + - id: get_channel + uses: actions/github-script@v6 with: + result-encoding: string script: | const version = '${{ github.event.inputs.tag }}'; - if(/^v\d+\.\d+\.\d+-\w+/.test(version)) { - core.setOutput('channel', 'prerelease'); - } else { - core.setOutput('channel', 'stable'); - } + return /^v\d+\.\d+\.\d+-\w+/.test(version) ? 'prerelease' : 'stable'; - name: build the operator bundle and save to temp directory run: | cd operator/ || exit 1 - VERSION='${{ github.event.inputs.tag }}' CHANNELS='${{ steps.get_channel.outputs.channel }}' DEFAULT_CHANNEL='stable' make bundle + VERSION='${{ github.event.inputs.tag }}' CHANNELS='${{ steps.get_channel.outputs.result }}' DEFAULT_CHANNEL='stable' make bundle echo 'copy-bundle-into-tmp' cp -r bundle/ /tmp/bundle-operator-move2kube cp bundle.Dockerfile /tmp/bundle.Dockerfile