Skip to content

Commit

Permalink
refactor release on tag push workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rabilrbl committed Aug 29, 2023
1 parent fb262bd commit 2d109f2
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/release_on_tag_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Generate release body
id: release_body
uses: actions/github-script@0.9.0
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

0 comments on commit 2d109f2

Please sign in to comment.