From e5bfcb9a041e88ad65529b14e1d5922340e64bb0 Mon Sep 17 00:00:00 2001 From: Simon Jagoe Date: Mon, 3 Jun 2024 13:18:30 +0300 Subject: [PATCH] Fix dry run failures due to bad && pipelines --- release-action-node/create-release.sh | 6 +++++- release-action-node/update-release-branch.sh | 6 +++++- release-action-node/update-without-release.sh | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/release-action-node/create-release.sh b/release-action-node/create-release.sh index 578be67..1aa730f 100755 --- a/release-action-node/create-release.sh +++ b/release-action-node/create-release.sh @@ -9,4 +9,8 @@ else npm install npm version "$VERSION" fi -[[ "${DRY_RUN,,}" == "false" ]] && git push && git push --tags +if [[ "${DRY_RUN,,}" == "false" ]]; then + git push && git push --tags +else + echo "[dry run] Push new version" 1>&2 +fi diff --git a/release-action-node/update-release-branch.sh b/release-action-node/update-release-branch.sh index 09340a5..a7b324c 100755 --- a/release-action-node/update-release-branch.sh +++ b/release-action-node/update-release-branch.sh @@ -6,4 +6,8 @@ set -euo pipefail package_version="$(jq -r .version < package.json)" release_branch="v${package_version//.*/}" git checkout -b "${release_branch}" -[[ "${DRY_RUN,,}" == "false" ]] && git push -u origin "${release_branch}" +if [[ "${DRY_RUN,,}" == "false" ]]; then + git push -u origin "${release_branch}" +else + echo "[dry run] Push changes to ${release_branch}" 1>&2 +fi diff --git a/release-action-node/update-without-release.sh b/release-action-node/update-without-release.sh index 782f04c..72d7f52 100755 --- a/release-action-node/update-without-release.sh +++ b/release-action-node/update-without-release.sh @@ -13,5 +13,9 @@ git_changes="$(git status --porcelain -- dist || true)" if [ -n "$git_changes" ]; then git add -- dist git commit -m "Update compiled action" - [[ "${DRY_RUN,,}" == "false" ]] && git push + if [[ "${DRY_RUN,,}" == "false" ]]; then + git push + else + echo "[dry run] Push changes" 1>&2 + fi fi