Skip to content

Commit

Permalink
♻️ use separate repo for tagging action
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindee authored and ianardee committed Dec 27, 2024
1 parent 7596a60 commit 10aa542
Showing 1 changed file with 2 additions and 38 deletions.
40 changes: 2 additions & 38 deletions .github/workflows/tag-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,5 @@ on:
- main

jobs:
tag-version:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, ':bookmark:')"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'

- name: Tag version
run: |
msg_start=':bookmark: Version '
version_format='[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}'
version=$(git log -1 --skip=0 --pretty=%s | grep -oP "(?<=${msg_start})${version_format}")
if [ -z "${version}" ]; then
echo 'Version not found, aborting.'
exit 1
fi
echo "Found version: ${version}";
tag="v${version}";
echo "Would tag: ${tag}";
existing_tag=$(git tag -l "${tag}");
if [ "${existing_tag}" ]; then
echo "Tag '${existing_tag}' already exists, aborting.";
exit 1;
fi
git config user.name "Mindee";
git config user.email "opensource@mindee.com"
git tag -a "${tag}" -m"Version ${version}";
git push origin "${tag}"
echo "Tagged and pushed: ${tag}"
tag:
uses: mindee/client-lib-actions/.github/workflows/tag-version.yml@main

0 comments on commit 10aa542

Please sign in to comment.