From 5cb1e118235bc13489fbf2db8f466ff568a1d4de Mon Sep 17 00:00:00 2001 From: Sergii Stotskyi Date: Tue, 21 Nov 2023 15:52:17 +0200 Subject: [PATCH] chore: fix release workflow whene there are no changes (#847) --- .github/workflows/release.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30a310f71..2ae02c6dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,18 +47,19 @@ jobs: set -o xtrace # Trace the execution of the script (debug) fi - changed_paths=$(gh pr view --json files --jq '.files.[].path' "${{ github.event.pull_request.number }}" | cut -d / -f 1,2 | uniq) - changed_packages=$(echo "$changed_paths" | grep ./packages) - pnpm_options='' - for path in $changed_packages; do - pnpm_options="${pnpm_options} --filter ./${path}" - done + changed_paths="$(gh pr view --json files --jq '.files.[].path' "${{ github.event.pull_request.number }}" | cut -d / -f 1,2 | uniq)" + changed_packages="$(echo "$changed_paths" | grep ./packages)" - if [ "$pnpm_options" = "" ]; then + if [ "$changed_packages" = "" ]; then echo -e "No packages to release:\n ${changed_paths}" >> $GITHUB_STEP_SUMMARY exit 0; fi + pnpm_options='' + for path in $changed_packages; do + pnpm_options="${pnpm_options} --filter ./${path}" + done + echo "running: pnpm run -r $pnpm_options release" >> $GITHUB_STEP_SUMMARY pnpm run -r $pnpm_options release