Skip to content

Commit edfadcd

Browse files
author
Mindee
committed
🔖 Version 4.15.0
1 parent 2d36762 commit edfadcd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/tag-version.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ on:
88
jobs:
99
tag-version:
1010
runs-on: ubuntu-latest
11+
if: "contains(github.event.head_commit.message, ':bookmark: Version ')"
12+
1113
steps:
1214
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: '0'
1317

14-
- name: Get version
15-
id: get_version
18+
- name: Tag version
1619
run: |
1720
msg_start=':bookmark: Version '
18-
version=$(\
19-
git log -1 --skip=0 --pretty=%s |\
20-
grep -oP "(?<=${msg_start})[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}" |\
21-
true\
22-
)
21+
version_format='[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}'
22+
version=$(git log -1 --skip=0 --pretty=%s | grep -oP "(?<=${msg_start})${version_format}")
2323
2424
if [ -z "${version}" ]; then
2525
echo 'Version not found, exiting.'
@@ -30,7 +30,8 @@ jobs:
3030
tag="v${version}";
3131
3232
echo "Would tag: ${tag}";
33-
existing_tag=$(git tag -l "$tag");
33+
existing_tag=$(git tag -l "${tag}");
34+
3435
if [ "${existing_tag}" ]; then
3536
echo "Tag '${existing_tag}' already exists, aborting.";
3637
exit 1;

0 commit comments

Comments
 (0)