Skip to content

Commit da76791

Browse files
author
rahul-infra
committed
updated release added ref to main branch
1 parent 8d60de0 commit da76791

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/release-preview.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ jobs:
5050
OUTPUT=$(npx semantic-release --dry-run --no-ci --branches main 2>&1 || true)
5151
echo "$OUTPUT"
5252
53-
# Extract version information
54-
NEW_VERSION=$(echo "$OUTPUT" | grep -oP "The next release version is \K[0-9]+\.[0-9]+\.[0-9]+" || echo "")
55-
RELEASE_TYPE=$(echo "$OUTPUT" | grep -oP "Analysis of \d+ commits complete: \K\w+ release" | sed 's/ release//' || echo "")
53+
# Extract version information (compatible with both GNU and BSD grep)
54+
NEW_VERSION=$(echo "$OUTPUT" | grep -Eo "The next release version is [0-9]+\.[0-9]+\.[0-9]+" | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" || echo "")
55+
RELEASE_TYPE=$(echo "$OUTPUT" | grep -Eo "Analysis of [0-9]+ commits complete: [a-z]+ release" | grep -Eo "(major|minor|patch) release" | sed 's/ release//' || echo "")
5656
5757
# Save to outputs
5858
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
@@ -64,6 +64,8 @@ jobs:
6464
echo "EOF" >> $GITHUB_OUTPUT
6565
env:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
GITHUB_REF: refs/heads/main
68+
GITHUB_REF_NAME: main
6769

6870
- name: Display Preview
6971
run: |

0 commit comments

Comments
 (0)