-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.5 KB
/
pull_request_release.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
name: Create Release PR Workflow
on:
workflow_dispatch:
inputs:
version:
description: 'Version name'
required: true
default: 'minor'
type: choice
options:
- major
- minor
- patch
jobs:
version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: npm install
- name: Set up Git
run: |
git config user.name "This Dot Open Source"
git config user.email "[email protected]"
- name: Update the version
id: update_version
run: |
echo "version=$(npm version ${{ github.event.inputs.version }} --no-git-tag-version)" >> $GITHUB_OUTPUT
- name: Update Changelog
id: update_changelog
run: |
sed -i 's/Unreleased/${{ steps.update_version.outputs.version }}/g' CHANGELOG.md
- name: Create pull request
id: create_pr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/${{ steps.update_version.outputs.version }}
title: 'Release: ${{ steps.update_version.outputs.version }} Pull Request'
body: 'This pull request contains the updated package.json with the new release version. By merging this PR the release flow will start'
base: main