-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): Create preview release job
- Loading branch information
1 parent
ee7971b
commit 9471f79
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Preview Release | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-preview: | ||
name: Preview Release | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config | ||
persist-credentials: false | ||
# Pull all previous tags | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
|
||
- name: Conventional Changelog Action | ||
id: conventional-changelog | ||
uses: TriPSs/conventional-changelog-action@v5 | ||
with: | ||
github-token: ${{ steps.app-token.outputs.token }} | ||
skip-git-pull: true | ||
skip-version-file: true | ||
git-push: false | ||
skip-commit: true | ||
skip-tag: true | ||
output-file: false | ||
skip-on-empty: false # Always create commit | ||
|
||
- name: Format Changelog | ||
id: format-changelog | ||
run: | | ||
echo "${{ steps.conventional-changelog.outputs.changelog }}" > step-changes.md | ||
{ | ||
echo 'changelog<<EOF' | ||
find . -type f -name 'step-changes.md' -print0 | xargs -0 sed -E 's/(^|[^!])\[(.*?)\]\(.*?\)/\1\2/g' | ||
echo EOF | ||
} >> "$GITHUB_OUTPUT" | ||
- name: Add PR Comment | ||
uses: mshick/add-pr-comment@v2 | ||
with: | ||
message: ${{ steps.format-changelog.outputs.changelog }} |