Skip to content

Create release PR

Create release PR #7

name: Create release PR
on:
workflow_dispatch:
inputs:
version:
description: 'New version'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
matrix:
node-version: [20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Create app token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.THEOPLAYER_BOT_APP_ID }}
private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Configure Git user
run: |
git config user.name 'theoplayer-bot[bot]'
git config user.email '873105+theoplayer-bot[bot]@users.noreply.github.com'
- name: Bump version
shell: bash
run: |
node ./scripts/set_version.js ${{ inputs.version }}
- name: Push to release branch
shell: bash
run: |
git commit -a -m ${{ inputs.version }}
git push origin "HEAD:release/${{ inputs.version }}"
- name: Create pull request
shell: bash
run: |
gh pr create \
--base main \
--head "release/${{ inputs.version }}" \
--title "Release ${{ inputs.version }}" \
--body "$(node ./scripts/github_changelog.js ${{ inputs.version }})"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}