Skip to content

Commit 13d6a8a

Browse files
authored
Add step to remove stableVersion fields from package.json
Added a step to remove 'stableVersion' fields from all package.json files during the release preparation workflow.
1 parent cf0f1e1 commit 13d6a8a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/release-prepare.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,23 @@ jobs:
4040
- name: Install dependencies
4141
run: yarn install --immutable
4242

43+
# 🔧 New step to remove stableVersion recursively
44+
- name: Remove all stableVersion fields
45+
run: |
46+
echo "Removing all stableVersion fields from package.json files..."
47+
find . -type f -name package.json -print0 | while IFS= read -r -d '' file; do
48+
if jq 'has("stableVersion")' "$file" | grep -q true; then
49+
echo "Cleaning $file"
50+
tmpfile=$(mktemp)
51+
jq 'del(.stableVersion)' "$file" > "$tmpfile" && mv "$tmpfile" "$file"
52+
fi
53+
done
54+
echo "All stableVersion fields removed."
55+
4356
- name: Update versions and samples
4457
run: |
45-
VERSION=${{ github.event.inputs.version }}
46-
echo "Updating all workspace versions to $VERSION"
47-
yarn workspaces foreach -Av version $VERSION
58+
echo "Updating all workspace versions to ${{ github.event.inputs.version }}"
59+
yarn workspaces foreach -Av version "${{ github.event.inputs.version }}"
4860
yarn update-samples
4961
5062
- name: Create Pull Request

0 commit comments

Comments
 (0)