Skip to content

Commit 2750903

Browse files
committed
feat: Add workflow dispatch
1 parent 148e732 commit 2750903

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/release.yml

+37-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
name: GitHub - Release
33

44
on:
5-
push:
5+
workflow_distach:
6+
inputs:
7+
bump:
8+
type: choice
9+
description: "The type of version bump to perform"
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
615
workflow_call:
716
inputs:
817
version:
@@ -14,8 +23,35 @@ permissions:
1423
contents: write
1524

1625
jobs:
26+
release-next:
27+
runs-on: ubuntu-latest
28+
# If the workflow was triggered by workflow_dispatch
29+
if: ${{ github.event_name == 'workflow_dispatch' }}
30+
steps:
31+
- name: "Checkout"
32+
uses: actions/checkout@v3
33+
34+
- name: "Patch Release Me"
35+
uses: 42ByteLabs/[email protected]
36+
with:
37+
mode: ${{ github.event.inputs.bump }}
38+
39+
- name: "Create Release"
40+
uses: peter-evans/create-pull-request@v6
41+
with:
42+
token: ${{ github.token }}
43+
commit-message: "[chore]: Create release for ${{ github.event.inputs.version }}"
44+
title: "[chore]: Create release for ${{ github.event.inputs.version }}"
45+
branch: chore-release-${{ github.event.inputs.version }}
46+
base: ${{ github.event.before }}
47+
labels: version
48+
body: |
49+
This is an automated PR to create a new release. The release will be created once this PR is merged.
50+
1751
release:
1852
runs-on: ubuntu-latest
53+
# If the workflow was triggered by a workflow call and the version is not null
54+
if: ${{ github.event_name == 'workflow_call' && github.event.inputs.version != null }}
1955
steps:
2056
# https://github.com/peter-murray/semver-data-action
2157
- name: Parse SemVer

0 commit comments

Comments
 (0)