-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor release on tag push workflow
- Loading branch information
Showing
1 changed file
with
3 additions
and
22 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 |
---|---|---|
|
@@ -16,32 +16,13 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
- name: Generate release body | ||
id: release_body | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const compareCommits = await github.repos.compareCommits({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
base: context.payload.before, | ||
head: context.payload.after | ||
}); | ||
const commits = compareCommits.data.commits; | ||
const commitMessages = commits.map(commit => commit.commit.message); | ||
const body = commitMessages.join('\n'); | ||
return body; | ||
- name: Generate Release | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
body: ${{ steps.release_body.outputs.result }} | ||
draft: false | ||
prerelease: false |