Skip to content

Commit

Permalink
chore: fix release workflow whene there are no changes (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
stalniy authored Nov 21, 2023
1 parent 8555bd7 commit 5cb1e11
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5cb1e11

Please sign in to comment.