Skip to content

Release - Create Release Candidate Branch #28

Release - Create Release Candidate Branch

Release - Create Release Candidate Branch #28

name: Release - Create Release Candidate Branch
# Triggered manually
on:
workflow_dispatch:
permissions:
contents: write
jobs:
create-release-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTION_TOKEN }}
ref: release
# It would be easier to create the branch from develop,
# but unfortunately the script that creates the PR's only considers commits added during the action run
- name: Merge latest from target branch
run: |
git config --global user.name 'Release Script'
git config --global user.email 'ott-release-script@jwplayer.com'
git fetch origin ${{ github.ref_name }}
git merge origin/${{ github.ref_name }}
yarn && yarn i18next
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
- name: Generate changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v5.1.0
with:
github-token: ${{ secrets.ACTION_TOKEN }}
release-count: 0
skip-tag: true
git-push: false
skip-ci: false
preset: conventionalcommits
input-file: 'CHANGELOG.md'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.ACTION_TOKEN }}
title: Release Candidate - ${{ steps.changelog.outputs.tag }}${{ github.ref_name != 'develop' && ' (Hotfix)' || ''}}
base: release
branch: ${{ github.ref_name == 'develop' && 'release-candidate' || 'hotfix-release-candidate' }}
body: ${{ steps.changelog.outputs.clean_changelog }}
labels: ${{github.ref_name == 'develop' && 'release-candidate' || 'release-candidate,hotfix'}}