Skip to content

Commit 7861837

Browse files
authored
Add "create release PR" github action (#4236)
This implementation: - Creates the base branch (name is based in user input) - Creates the release branch (name is based in user input) - Creates the release.cfg file in the release branch without adding any SDK (module) to it. It can create the branches based on any existing branch of the repo.
1 parent 6df2784 commit 7861837

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/create_releases.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Create release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
name:
7+
description: 'Release name'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
create-branches:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- name: Create base branch
18+
uses: peterjgrainger/[email protected]
19+
with:
20+
branch: '${{ inputs.name }}'
21+
- name: Create release branch
22+
uses: peterjgrainger/[email protected]
23+
with:
24+
branch: '${{ inputs.name }}.release'
25+
26+
create-pull-request:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
31+
- name: Create release configuration template
32+
run: |
33+
git config user.name 'Create Release GA'
34+
git config user.email '[email protected]'
35+
echo "[release]" > release.cfg
36+
echo "name = ${{ inputs.name }}" >> release.cfg
37+
echo "mode = RELEASE" >> release.cfg
38+
echo "" >> release.cfg
39+
echo "[modules]" >> release.cfg
40+
echo "" >> release.cfg
41+
git add release.cfg
42+
git commit -a -m 'Create release config'
43+
44+
- name: Create Pull Request
45+
uses: peter-evans/create-pull-request@v4
46+
with:
47+
base: '${{ inputs.name }}'
48+
branch: '${{ inputs.name }}.release'
49+
title: '${{ inputs.name}} release'

0 commit comments

Comments
 (0)