Skip to content

Commit

Permalink
PB-579: Use PR body instead of title to set the bump type
Browse files Browse the repository at this point in the history
This allow for a cleaner release notes as the release notes uses the PR titles.
  • Loading branch information
ltshb committed Jun 6, 2024
1 parent 32fbfb4 commit a277388
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/pr-auto-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,16 @@ jobs:
pr_title="${PR_TITLE}"
pr_title=$(echo ${pr_title} | sed "s/[ ]*-*[ ]*#${bump_type}//")
echo "Remove bump type from original body"
pr_body="${PR_BODY}"
pr_body=$(echo ${pr_body} | sed "s/[ ]*-*[ ]*#${bump_type}//")
echo "pr_title=${pr_title}" >> $GITHUB_OUTPUT
echo "Original title set to '${pr_title}'"
echo "pr_body=${pr_body}" >> $GITHUB_OUTPUT
echo "Original body set to '${pr_body}'"
echo "default_bump=${bump_type}" >> $GITHUB_OUTPUT
echo "Bump type set to ${bump_type}"
Expand Down Expand Up @@ -115,7 +122,15 @@ jobs:
run: |
gh api /repos/${{ github.repository }}/pulls/${PR_NUMBER} \
--method "PATCH" \
-f "title=New Release ${{ steps.get_tag.outputs.new_tag }} - #${{ steps.get_tag.outputs.part }}"
-H "Accept: application/vnd.github.v3+json" \
-f "title=New Release ${{ steps.get_tag.outputs.new_tag }}" \
-f "$(cat <<EOF
body=${{ steps.bump_type.outputs.pr_body }}
\#${{ steps.get_tag.outputs.part }}
EOF
)"

#-f "body=${{ steps.bump_type.outputs.pr_body }}\n#${{ steps.get_tag.outputs.part }}"

- name: Add default bump type based on PR information
if: ${{ github.head_ref != 'develop' }}
Expand All @@ -125,7 +140,9 @@ jobs:
run: |
gh api /repos/${{ github.repository }}/pulls/${PR_NUMBER} \
--method "PATCH" \
-f "title=${{ steps.bump_type.outputs.pr_title }} - #${{ steps.bump_type.outputs.default_bump }}"
-H "Accept: application/vnd.github.v3+json" \
-f "title=${{ steps.bump_type.outputs.pr_title }}" \
-f "body=${{ steps.bump_type.outputs.pr_body }}\n#${{ steps.bump_type.outputs.default_bump }}"
pr-labeler:
name: Set PR label
Expand Down

0 comments on commit a277388

Please sign in to comment.