File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 11name : Create Release
2+ # Creates a GitHub release when a PR is merged to main, using the PR title as the version (must start with 'v') and PR body as release notes.
23
34on :
45 pull_request :
@@ -17,23 +18,23 @@ jobs:
1718 with :
1819 fetch-depth : 0
1920
20- - name : Get PR information
21- id : pr_data
21+ - name : Get PR title
22+ id : pr_title
23+ run : echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
24+
25+ - name : Save PR body to file
2226 run : |
23- echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_OUTPUT
24- echo "body<<EOF" >> $GITHUB_OUTPUT
25- echo "${{ github.event.pull_request.body }}" >> $GITHUB_OUTPUT
26- echo "EOF" >> $GITHUB_OUTPUT
27+ echo '${{ github.event.pull_request.body }}' > pr_body.txt
2728
2829 - name : Extract version
2930 id : extract_version
3031 run : |
31- PR_TITLE="${{ steps.pr_data .outputs.title }}"
32+ PR_TITLE="${{ steps.pr_title .outputs.title }}"
3233 if [[ $PR_TITLE =~ ^v ]]; then
3334 echo "version=$PR_TITLE" >> $GITHUB_OUTPUT
3435 echo "Valid version format found in PR title: $PR_TITLE"
3536 else
36- echo "Error: PR title must start with 'v' to make a new release"
37+ echo "Error: PR title '$PR_TITLE' must start with 'v' (e.g., 'v1.0.0') to create a release. "
3738 exit 1
3839 fi
3940
4243 with :
4344 tag_name : ${{ steps.extract_version.outputs.version }}
4445 name : Release ${{ steps.extract_version.outputs.version }}
45- body : ${{ steps.pr_data.outputs.body }}
46+ body_path : pr_body.txt
4647 draft : false
4748 prerelease : false
4849 env :
You can’t perform that action at this time.
0 commit comments