Skip to content

Commit

Permalink
Fix release generation (#371)
Browse files Browse the repository at this point in the history
- Fix incorrect tag.
- Do not create as a pre-release.
- Ignore more automated authors.
  • Loading branch information
martincostello authored Jun 7, 2024
1 parent a8ed249 commit 989937f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
- name: Create release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
DRAFT: ${{ inputs.publish != true }}
VERSION: ${{ steps.get-version.outputs.version }}
with:
Expand All @@ -49,29 +50,27 @@ jobs:
const tag_name = `v${version}`;
const name = tag_name;
const { data: release } = await github.rest.repos.createRelease({
const { data: notes } = await github.rest.repos.generateReleaseNotes({
owner,
repo,
tag_name,
name,
draft: true,
generate_release_notes: true,
prerelease: true,
target_commitish: process.env.DEFAULT_BRANCH,
});
const release_id = release.id;
const body = release.body
const body = notes.body
.split('\n')
.filter((line) => !line.includes(' @costellobot '))
.filter((line) => !line.includes(' @dependabot '))
.filter((line) => !line.includes(' @github-actions '))
.join('\n');
const { data: updated } = await github.rest.repos.updateRelease({
const { data: release } = await github.rest.repos.createRelease({
owner,
repo,
release_id,
draft,
tag_name,
name,
body,
draft,
});
core.notice(`Created release ${updated.name}: ${updated.html_url}`);
core.notice(`Created release ${release.name}: ${release.html_url}`);

0 comments on commit 989937f

Please sign in to comment.