-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.18 KB
/
create_release_pr.yaml
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
name: create_release_pr
on:
push:
branches:
- "release/**"
- "hotfix/**"
jobs:
create_release_pr:
name: Create release pull request
runs-on: ubuntu-latest
permissions:
contents: write
# only create draft pull requests on
# pushing to branches 'release/' or 'hotfix/'
if: |
startsWith(github.ref_name, 'release/') ||
startsWith(github.ref_name, 'hotfix/')
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}
token: ${{ secrets.GH_TOKEN }}
# needed by "gh pr create"
fetch-depth: 0
- name: Set release type as release
if: startsWith(github.ref_name, 'release/')
run: echo "RELEASE_TYPE=release" >> "$GITHUB_ENV"
- name: Set release type as hotfix
if: startsWith(github.ref_name, 'hotfix/')
run: echo "RELEASE_TYPE=hotfix" >> "$GITHUB_ENV"
- name: Test action 'Create release PR'
uses: ghacts/gitflow/create-release-pr@main
with:
token: ${{ secrets.GH_TOKEN }}
release-type: ${{ env.RELEASE_TYPE }}
release-branch-prefix: '${{ env.RELEASE_TYPE }}/'