From 0240b8e9cb3089dbaae78d447eeb3901ed8cdcb4 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:29:43 +0200 Subject: [PATCH] Do not fail workflow if no chainlink image found in setup-parse-base64-config --- .github/actions/setup-merge-base64-config/action.yml | 10 ++++------ .github/actions/setup-parse-base64-config/action.yml | 8 +++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup-merge-base64-config/action.yml b/.github/actions/setup-merge-base64-config/action.yml index b734873c1f6..79dc8758315 100644 --- a/.github/actions/setup-merge-base64-config/action.yml +++ b/.github/actions/setup-merge-base64-config/action.yml @@ -24,22 +24,20 @@ runs: echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - CHAINLINK_IMAGE=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.image') + CHAINLINK_IMAGE=$(echo "$decoded_toml" | { dasel -r toml 'ChainlinkImage.image' 2>/dev/null || echo ''; }) echo ::add-mask::$CHAINLINK_IMAGE - CHAINLINK_VERSION=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.version') + CHAINLINK_VERSION=$(echo "$decoded_toml" | { dasel -r toml 'ChainlinkImage.version' 2>/dev/null || echo ''; }) NETWORKS=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*selected_networks[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) if [ -n "$CHAINLINK_IMAGE" ]; then echo "CHAINLINK_IMAGE=$CHAINLINK_IMAGE" >> $GITHUB_ENV else - echo "No Chainlink Image found in base64-ed config. Exiting" - exit 1 + echo "No Chainlink Image found in base64-ed config" fi if [ -n "$CHAINLINK_VERSION" ]; then echo "CHAINLINK_VERSION=$CHAINLINK_VERSION" >> $GITHUB_ENV else - echo "No Chainlink Version found in base64-ed config. Exiting" - exit 1 + echo "No Chainlink Version found in base64-ed config" fi if [ -n "$NETWORKS" ]; then echo "NETWORKS=$NETWORKS" >> $GITHUB_ENV diff --git a/.github/actions/setup-parse-base64-config/action.yml b/.github/actions/setup-parse-base64-config/action.yml index 5e03c6de284..72e8982e6d0 100644 --- a/.github/actions/setup-parse-base64-config/action.yml +++ b/.github/actions/setup-parse-base64-config/action.yml @@ -20,23 +20,21 @@ runs: shell: bash run: | decoded_toml=$(echo $BASE64_CONFIG_OVERRIDE | base64 -d) - CHAINLINK_IMAGE=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.image') + CHAINLINK_IMAGE=$(echo "$decoded_toml" | { dasel -r toml 'ChainlinkImage.image' 2>/dev/null || echo ''; }) echo ::add-mask::$CHAINLINK_IMAGE - CHAINLINK_VERSION=$(echo "$decoded_toml" | dasel -r toml 'ChainlinkImage.version') + CHAINLINK_VERSION=$(echo "$decoded_toml" | { dasel -r toml 'ChainlinkImage.version' 2>/dev/null || echo ''; }) NETWORKS=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*selected_networks[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) ETH2_EL_CLIENT=$(echo "$decoded_toml" | awk -F'=' '/^[[:space:]]*execution_layer[[:space:]]*=/ {gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2); print $2}' 2>/dev/null) if [ -n "$CHAINLINK_IMAGE" ]; then echo "CHAINLINK_IMAGE=$CHAINLINK_IMAGE" >> $GITHUB_ENV else - echo "No Chainlink Image found in base64-ed config. Exiting" - exit 1 + echo "No Chainlink Image found in base64-ed config" fi if [ -n "$CHAINLINK_VERSION" ]; then echo "CHAINLINK_VERSION=$CHAINLINK_VERSION" >> $GITHUB_ENV else echo "No Chainlink Version found in base64-ed config. Exiting" - exit 1 fi if [ -n "$NETWORKS" ]; then echo "NETWORKS=$NETWORKS" >> $GITHUB_ENV