Release - Create Release Candidate Branch #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
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 workspace @jwp/ott-web run 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@v6 | |
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'}} |