Skip to content

Commit 10aa542

Browse files
Mindeeianardee
authored andcommitted
♻️ use separate repo for tagging action
1 parent 7596a60 commit 10aa542

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

.github/workflows/tag-version.yml

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,5 @@ on:
66
- main
77

88
jobs:
9-
tag-version:
10-
runs-on: ubuntu-latest
11-
if: "contains(github.event.head_commit.message, ':bookmark:')"
12-
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: '0'
17-
18-
- name: Tag version
19-
run: |
20-
msg_start=':bookmark: Version '
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}")
23-
24-
if [ -z "${version}" ]; then
25-
echo 'Version not found, aborting.'
26-
exit 1
27-
fi
28-
29-
echo "Found version: ${version}";
30-
tag="v${version}";
31-
32-
echo "Would tag: ${tag}";
33-
existing_tag=$(git tag -l "${tag}");
34-
35-
if [ "${existing_tag}" ]; then
36-
echo "Tag '${existing_tag}' already exists, aborting.";
37-
exit 1;
38-
fi
39-
40-
git config user.name "Mindee";
41-
git config user.email "opensource@mindee.com"
42-
43-
git tag -a "${tag}" -m"Version ${version}";
44-
git push origin "${tag}"
45-
46-
echo "Tagged and pushed: ${tag}"
9+
tag:
10+
uses: mindee/client-lib-actions/.github/workflows/tag-version.yml@main

0 commit comments

Comments
 (0)