-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.96 KB
/
version.yml
File metadata and controls
55 lines (48 loc) · 1.96 KB
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
name: Bump version
on:
push:
branches:
- master
issue_comment:
types: [created]
workflow_dispatch:
env:
BOT_PR_BRANCH: version-bump
BOT_PR_TITLE: 'Bump version'
BOT_REFERENCE_BRANCH: master
BOT_COMMAND_PREFIX: versionbot
jobs:
update:
name: Create or update PR
if:
github.event_name == 'push' || github.event_name == 'workflow_dispatch' || ( github.event_name == 'issue_comment' && github.event.issue.title=='Bump version' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.BOT_REFERENCE_BRANCH }}
- name: Update version in package.json ✏️
run: |
npm version --no-git-tag-version patch
working-directory: ./
- name: Update version in package.json ✏️
run: |
npm version --no-git-tag-version minor
working-directory: ./
if:
contains(github.event.comment.body, 'versionbot') && contains(github.event.comment.body, 'minor')
- name: Update version in package.json ✏️
run: |
npm version --no-git-tag-version major
working-directory: ./
if:
contains(github.event.comment.body, 'versionbot') && contains(github.event.comment.body, 'major')
- name: Create Pull Request 📤
uses: peter-evans/create-pull-request@v4
with:
base: ${{ env.BOT_REFERENCE_BRANCH }}
branch: ${{ env.BOT_PR_BRANCH }}
title: ${{ env.BOT_PR_TITLE }}
author: ${{ env.BOT_COMMAND_PREFIX }} <noreply@github.com>
committer: ${{ env.BOT_COMMAND_PREFIX }} <noreply@github.com>
body: 'Post a comment like `@versionbot minor` to bump the version further'