-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (36 loc) · 1.19 KB
/
bump.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
name: Bump version in git
on:
push:
branches:
- main
jobs:
# Useful for workflow debugging
# printJob:
# name: Print event
# runs-on: ubuntu-latest
# steps:
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo "$GITHUB_CONTEXT"
bump_version:
runs-on: ubuntu-latest
steps:
- name: Check-out repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Config git
run: |
git config --global user.email "github+actions@gmail.com"
git config --global user.name "Actions"
- name: Bump major
if: contains(github.event.head_commit.message, '[version:major]')
run: .github/workflows/bump.sh major
- name: Bump minor
if: "!contains(github.event.head_commit.message, '[version:major]') && contains(github.event.head_commit.message, '[version:minor]')"
run: .github/workflows/bump.sh minor
- name: Bump patch
if: "!contains(github.event.head_commit.message, '[version:major]') && !contains(github.event.head_commit.message, '[version:minor]')"
run: .github/workflows/bump.sh patch