-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.11 KB
/
tag.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
###############################################################################
#
# AUTHOR: Maciej_Bak
# CONTACT: wsciekly.maciek@gmail.com
# CREATED: 03-05-2023
# LICENSE: Apache_2.0
#
###############################################################################
---
name: tag
on:
pull_request:
types:
- closed
jobs:
tag:
runs-on: ubuntu-22.04
name: ubuntu-22.04
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'master'
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.CHANGELOG_TOKEN }}
submodules: "true"
- name: Check version bump
run: |
GIT='git --git-dir='$PWD'/.git'
NEW_COMMIT_VERSION="$(cat VERSION)"
$GIT checkout HEAD~1
PREVIOUS_COMMIT_VERSION="$(cat VERSION)"
$GIT checkout -
if [[ "$NEW_COMMIT_VERSION" != "$PREVIOUS_COMMIT_VERSION" ]]
then
$GIT tag $NEW_COMMIT_VERSION
$GIT push origin $NEW_COMMIT_VERSION
fi
...