-
Notifications
You must be signed in to change notification settings - Fork 55
50 lines (46 loc) · 1.79 KB
/
release-create-release-candidate-branch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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'}}