Skip to content

Commit 2ce524f

Browse files
author
rahul-infra
committed
fix: updated versions.tf
1 parent 5816a0d commit 2ce524f

File tree

1 file changed

+21
-34
lines changed

1 file changed

+21
-34
lines changed

.github/workflows/version-preview.yaml

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,28 @@ jobs:
2121
with:
2222
fetch-depth: 0
2323

24-
- name: Analyze PR commits
24+
- name: Semantic Release (Dry Run)
2525
id: semantic
26-
run: |
27-
git fetch origin ${{ github.base_ref }}
28-
29-
COMMITS=$(git log origin/${{ github.base_ref }}..HEAD --pretty=format:"%s")
30-
31-
if echo "$COMMITS" | grep -qE "^[a-z]+(\(.+\))?!:|BREAKING CHANGE:"; then
32-
TYPE="major"
33-
elif echo "$COMMITS" | grep -qE "^feat(\(.+\))?:"; then
34-
TYPE="minor"
35-
elif echo "$COMMITS" | grep -qE "^fix(\(.+\))?:"; then
36-
TYPE="patch"
37-
else
38-
TYPE="none"
39-
fi
40-
41-
if [ "$TYPE" != "none" ]; then
42-
CURRENT=$(git tag --sort=-v:refname | head -1 | sed 's/^v//')
43-
IFS='.' read -r maj min pat <<< "$CURRENT"
44-
45-
[ "$TYPE" = "major" ] && maj=$((maj + 1)) && min=0 && pat=0
46-
[ "$TYPE" = "minor" ] && min=$((min + 1)) && pat=0
47-
[ "$TYPE" = "patch" ] && pat=$((pat + 1))
48-
49-
echo "new_release_published=true" >> $GITHUB_OUTPUT
50-
echo "new_release_version=$maj.$min.$pat" >> $GITHUB_OUTPUT
51-
echo "new_release_type=$TYPE" >> $GITHUB_OUTPUT
52-
echo "new_release_notes<<EOF" >> $GITHUB_OUTPUT
53-
echo "## Changes in this PR" >> $GITHUB_OUTPUT
54-
echo "$COMMITS" | sed 's/^/- /' >> $GITHUB_OUTPUT
55-
echo "EOF" >> $GITHUB_OUTPUT
56-
else
57-
echo "new_release_published=false" >> $GITHUB_OUTPUT
58-
fi
26+
uses: cycjimmy/semantic-release-action@v4
27+
with:
28+
semantic_version: 18.0.0
29+
dry_run: true
30+
branches: |
31+
[
32+
'+([0-9])?(.{+([0-9]),x}).x',
33+
'main',
34+
'master',
35+
{
36+
name: '*',
37+
prerelease: true
38+
}
39+
]
40+
extra_plugins: |
41+
@semantic-release/changelog@6.0.0
42+
@semantic-release/git@10.0.0
43+
conventional-changelog-conventionalcommits@4.6.3
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5946

6047
- name: Comment PR
6148
if: always()

0 commit comments

Comments
 (0)