Skip to content

Commit

Permalink
fix: update version-packages workflow (#94) (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjie-w authored Dec 30, 2024
1 parent d3d9cda commit 6d3853d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/version-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,21 @@ jobs:
github-releases:
name: Create GitHub Releases
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && contains(toJSON(github.event.commits.*.removed), '.changeset/'))
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for Changesets File Deletions
id: check-changesets
run: |
DELETED_CHANGESETS=$(git diff --name-status HEAD^ HEAD | grep "^D.*\.changeset/.*\.md$" || true)
if [ -z "$DELETED_CHANGESETS" ]; then
echo "No changeset files were deleted - skipping releases"
exit 0
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -79,11 +85,6 @@ jobs:
continue
fi
if [[ ! "$new_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then
echo "Invalid version format for $package_name: $new_version"
exit 1
fi
if [[ "$new_version" != "$old_version" ]]; then
echo "Package $package_name version change detected:"
echo " $old_version → $new_version"
Expand Down

0 comments on commit 6d3853d

Please sign in to comment.