Skip to content

Commit

Permalink
fix: grep error in version-release workflow (#89) (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
junjie-w committed Dec 30, 2024
1 parent 00dc58c commit cb0046f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/version-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ jobs:
run: |
if [[ "${{ steps.changesets.outputs.hasChangesets }}" == "true" ]]; then
echo "✨ Version updates created"
shopt -s nullglob
for changeset in .changeset/*.md; do
if [ -f "$changeset" ]; then
<<<<<<< HEAD
pkg_info=$(grep -A 1 -e "---" "$changeset")
echo "$pkg_info"
=======
pkg_info=$(grep -A 1 -e "---" "$changeset" || true)
[ ! -z "$pkg_info" ] && echo "$pkg_info"
>>>>>>> 5bc9c44 (fix: grep error in version-release workflow (#89) (#90))
fi
done
else
Expand All @@ -65,12 +71,13 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: steps.changesets.outputs.hasChangesets == 'true'
run: |
shopt -s nullglob
for changeset in .changeset/*.md; do
if [ -f "$changeset" ]; then
name=$(grep -A 1 -e "---" "$changeset" | grep "@api-client-sdk-streamline-sample" | tr -d '"' | awk '{print $1}')
version=$(grep -A 1 -e "---" "$changeset" | grep "@api-client-sdk-streamline-sample" | awk '{print $2}')
if [ ! -z "$name" ]; then
if [ ! -z "$name" ] && [ ! -z "$version" ]; then
echo "Creating release for $name v$version"
gh workflow run release-base.yml \
-f package-name="$name" \
Expand Down

0 comments on commit cb0046f

Please sign in to comment.