Skip to content

Commit d789734

Browse files
committed
feat: replace since by diff
1 parent 209bfa8 commit d789734

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.github/workflows/ci-cd.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ jobs:
144144
run: |
145145
echo "🔍 Checking for changes requiring versioning..."
146146
147-
# Simple approach: check against origin/develop (like in PR workflow)
147+
# Simple approach: check against origin/develop using --diff
148148
# This works for both first releases and merges
149-
CHANGED_PACKAGES=$(melos list --since=origin/develop --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
149+
CHANGED_PACKAGES=$(melos list --diff=origin/develop --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
150150
151151
# If no changes found, it might be because we're on develop or first commit
152152
if [ "$CHANGED_PACKAGES" -eq 0 ]; then
@@ -156,7 +156,7 @@ jobs:
156156
PACKAGE_TAGS=$(git tag -l "*@*" | wc -l || echo "0")
157157
if [ "$PACKAGE_TAGS" -eq 0 ]; then
158158
echo "🎉 No package tags found - treating as first release"
159-
CHANGED_PACKAGES=$(melos list --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
159+
CHANGED_PACKAGES=$(melos list --no-private --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
160160
fi
161161
fi
162162
@@ -167,10 +167,10 @@ jobs:
167167
if [ "$CHANGED_PACKAGES" -gt 0 ]; then
168168
echo "📋 Changed packages:"
169169
if [ "$PACKAGE_TAGS" -eq 0 ]; then
170-
echo "First release - all packages:"
171-
melos list --long 2>/dev/null || echo "Unable to list packages"
170+
echo "First release - all public packages:"
171+
melos list --no-private --long 2>/dev/null || echo "Unable to list packages"
172172
else
173-
melos list --since=origin/develop --long 2>/dev/null || echo "Unable to list changed packages"
173+
melos list --diff=origin/develop --long 2>/dev/null || echo "Unable to list changed packages"
174174
fi
175175
fi
176176

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
echo "Base branch: $BASE_BRANCH"
105105
106106
# Get changed packages
107-
CHANGED_PACKAGES=$(melos list --since=origin/$BASE_BRANCH --json 2>/dev/null | jq -r '.[].name' | tr '\n' ',' | sed 's/,$//' || echo "")
107+
CHANGED_PACKAGES=$(melos list --diff=origin/$BASE_BRANCH --json 2>/dev/null | jq -r '.[].name' | tr '\n' ',' | sed 's/,$//' || echo "")
108108
echo "Changed packages: $CHANGED_PACKAGES"
109109
echo "changed-packages=$CHANGED_PACKAGES" >> $GITHUB_OUTPUT
110110

melos.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ scripts:
237237
ci:check-changes:
238238
run: |
239239
echo "🔍 Checking for changes since last release..."
240-
CHANGED_PACKAGES=$(melos list --since=HEAD~1 --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
240+
CHANGED_PACKAGES=$(melos list --diff=HEAD~1 --json 2>/dev/null | jq -r '.[].name' | wc -l || echo "0")
241241
echo "Found $CHANGED_PACKAGES packages with changes"
242242
if [ "$CHANGED_PACKAGES" -gt 0 ]; then
243243
echo "📦 Changed packages:"
244-
melos list --since=HEAD~1 --long 2>/dev/null || echo "Unable to determine changed packages"
244+
melos list --diff=HEAD~1 --long 2>/dev/null || echo "Unable to determine changed packages"
245245
exit 0
246246
else
247247
echo "⏭️ No packages have changes"

0 commit comments

Comments
 (0)