-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (54 loc) · 1.99 KB
/
prepare-hotfix.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Prepare hotfix"
on:
workflow_dispatch:
inputs:
version:
description: "The version you want to release."
required: true
jobs:
prepare-hotfix:
name: Prepare hotfix
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".node-version"
- name: Setup Yarn
uses: volta-cli/action@v4
- name: Setup env
run: echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
- name: Create hotfix branch
run: git checkout -b hotfix/${{ github.event.inputs.version }}
- name: Initialize mandatory git config
uses: fregante/setup-git-user@v2
- name: Bump version in package.json
run: yarn version --new-version ${{ github.event.inputs.version }} --no-git-tag-version
- name: Commit manifest files
id: make-commit
run: |
git add package.json
git commit --message "Prepare hotfix ${{ github.event.inputs.version }}"
echo "::set-output name=commit::$(git rev-parse HEAD)"
- name: Publish hotfix branch
run: git push origin hotfix/${{ github.event.inputs.version }}
- name: Merge hotfix into main branch
uses: thomaseizinger/create-pull-request@1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: hotfix/${{ github.event.inputs.version }}
base: main
title: Merge hotfix/${{ github.event.inputs.version }} into main branch
- name: Merge hotfix into develop branch
uses: thomaseizinger/create-pull-request@1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
head: hotfix/${{ github.event.inputs.version }}
base: develop
title: Merge hotfix/${{ github.event.inputs.version }} into develop branch