Skip to content

release

release #3

Workflow file for this run

name: release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to create the release for.'
required: true
type: string
permissions: {}
jobs:
release:
runs-on: [ ubuntu-latest ]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Create release
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
VERSION: ${{ inputs.version }}
with:
script: |
const { repo, owner } = context.repo;
const draft = true;
let version = process.env.VERSION;
if (version.startsWith('v')) {
version = version.slice(1);
}
const tag_name = version;
const name = tag_name;
const { data: notes } = await github.rest.repos.generateReleaseNotes({
owner,
repo,
tag_name,
target_commitish: process.env.DEFAULT_BRANCH,
});
const body = notes.body
.split('\n')
.filter((line) => !line.includes(' @dependabot '))
.filter((line) => !line.includes(' @github-actions '))
.filter((line) => !line.includes(' @polly-updater-bot '))
.join('\n');
const { data: release } = await github.rest.repos.createRelease({
owner,
repo,
tag_name,
name,
body,
draft,
});
core.notice(`Created release ${release.name}: ${release.html_url}`);