You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/semantic-check.yml
+14-23Lines changed: 14 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
name: Semantic Version Check
2
2
3
3
on:
4
-
pull_request:
4
+
pull_request_target:
5
5
types: [opened, synchronize, reopened]
6
6
7
7
jobs:
@@ -17,6 +17,7 @@ jobs:
17
17
- name: Checkout
18
18
uses: actions/checkout@v4
19
19
with:
20
+
ref: ${{ github.event.pull_request.head.sha }}
20
21
fetch-depth: 0
21
22
persist-credentials: false
22
23
@@ -46,28 +47,18 @@ jobs:
46
47
@semantic-release/release-notes-generator
47
48
env:
48
49
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49
-
50
-
- name: Create comment content
51
-
id: create-comment
52
-
run: |
53
-
if [ "${{ steps.semantic.outputs.new_release_version }}" != "" ]; then
54
-
echo "comment_body=## Semantic Version Check\n\n✅ Valid semantic version changes detected!\n\nNext version will be: **${{ steps.semantic.outputs.new_release_version }}**" >> $GITHUB_OUTPUT
55
-
else
56
-
echo "comment_body=## Semantic Version Check\n\n⚠️ No semantic version changes detected.\n\nPlease ensure your commits follow the [Conventional Commits](https://www.conventionalcommits.org/) format:\n\n- \`feat: new feature\` (triggers MINOR version bump)\n- \`fix: bug fix\` (triggers PATCH version bump)\n- \`BREAKING CHANGE: description\` (triggers MAJOR version bump)" >> $GITHUB_OUTPUT
${{ steps.semantic.outputs.new_release_version && '✅ Valid semantic version changes detected!' || '⚠️ No semantic version changes detected.' }}
58
+
59
+
${{ steps.semantic.outputs.new_release_version && format('Next version will be: **{0}**', steps.semantic.outputs.new_release_version) || 'Please ensure your commits follow the [Conventional Commits](https://www.conventionalcommits.org/) format:
0 commit comments