Skip to content

Commit 3a43773

Browse files
committed
chore: refactored release flow
1 parent c39eb20 commit 3a43773

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ concurrency:
3030

3131
jobs:
3232
manual-publish:
33-
if: github.event.inputs.release_tag != ''
33+
if: inputs.release_tag != ''
3434
runs-on: ubuntu-latest
3535
steps:
3636
- uses: actions/checkout@v4
@@ -53,7 +53,7 @@ jobs:
5353
run: npm publish --provenance --access public
5454

5555
check-release:
56-
if: github.event.inputs.release_tag == ''
56+
if: inputs.release_tag == ''
5757
runs-on: ubuntu-latest
5858
outputs:
5959
is_release: ${{ steps.check.outputs.is_release }}
@@ -296,31 +296,28 @@ jobs:
296296
297297
EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --json number -q '.[0].number' || echo "")
298298
299-
PR_BODY="## Release v$NEXT_VERSION
299+
PR_BODY=$(cat <<EOF
300+
## Release v$NEXT_VERSION
300301
301-
This PR was automatically created by the release workflow.
302+
This PR was automatically created by the release workflow.
302303
303-
**Bump type:** $BUMP_TYPE
304+
**Bump type:** $BUMP_TYPE
304305
305-
### Changes
306-
$CHANGELOG_CONTENT
306+
### Changes
307+
$CHANGELOG_CONTENT
307308
308-
---
309-
*Merge this PR to publish v$NEXT_VERSION to npm.*"
309+
---
310+
*Merge this PR to publish v$NEXT_VERSION to npm.*
311+
EOF
312+
)
310313
311314
if [[ -n "$EXISTING_PR" ]]; then
312315
echo "Updating existing PR #$EXISTING_PR"
313-
gh pr edit "$EXISTING_PR" \
314-
--title "chore: release v$NEXT_VERSION" \
315-
--body "$PR_BODY"
316+
gh pr edit "$EXISTING_PR" --title "chore: release v$NEXT_VERSION" --body "$PR_BODY"
316317
echo "::notice::Updated PR #$EXISTING_PR"
317318
else
318319
echo "Creating new PR"
319-
gh pr create \
320-
--base master \
321-
--head "$BRANCH_NAME" \
322-
--title "chore: release v$NEXT_VERSION" \
323-
--body "$PR_BODY"
320+
gh pr create --base master --head "$BRANCH_NAME" --title "chore: release v$NEXT_VERSION" --body "$PR_BODY"
324321
echo "::notice::Created new release PR"
325322
fi
326323

0 commit comments

Comments
 (0)