Skip to content

Create release PR

Create release PR #10

name: Create release PR
on:
workflow_dispatch:
inputs:
version:
description: Version
required: true
jobs:
create-pull-request:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11.3
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
- name: Install base dependencies
run: poetry install --sync --only base
- name: Bump version and changelog
id: changelog
run: |
poetry run invoke release.install release.build -- -v ${{ github.event.inputs.version }} > entry.md
cat entry.md
body=$(cat entry.md)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "body=$body" >> $GITHUB_OUTPUT
- name: Create pull request
uses: peter-evans/create-pull-request@v5.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "release: v${{ github.event.inputs.version }}"
title: "release: v${{ github.event.inputs.version }}"
body: ${{ steps.changelog.outputs.body }}
branch: release/${{ github.event.inputs.version }}