File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 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
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 : |
You can’t perform that action at this time.
0 commit comments