From 107c88d0e03b06422c17dce498d858e584d55d92 Mon Sep 17 00:00:00 2001 From: greensd4 Date: Mon, 26 Aug 2024 12:14:55 +0300 Subject: [PATCH 1/3] modify release file --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48c9ec8..66019e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,9 +21,18 @@ jobs: - name: Get the latest tag id: get_tag run: echo ::set-output name=tag::$(git describe --tags `git rev-list --tags --max-count=1`) - - name: Get the PR Title + - name: Get and Format the PR Title id: get_pr_title - run: echo ::set-output name=pr_title::${{ github.event.pull_request.title }} + run: | + pr_title="${{ github.event.pull_request.title }}" + # Use grep with regex to extract the format (AST-000) from the title + formatted_title=$(echo "$pr_title" | grep -oE "\(AST-[0-9]+\)") + # If formatted_title is empty, set a default value or handle the error + if [ -z "$formatted_title" ]; then + echo "No valid format found in PR title." + exit 1 + fi + echo "formatted_title=$formatted_title" >> $GITHUB_ENV - name: Bump Patch Version id: bump uses: cbrgm/semver-bump-action@main From 225a72678f32f241fe804992c29480145e16bd42 Mon Sep 17 00:00:00 2001 From: greensd4 Date: Mon, 26 Aug 2024 12:36:01 +0300 Subject: [PATCH 2/3] changes --- .github/workflows/release.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66019e4..501a4a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,12 +33,18 @@ jobs: exit 1 fi echo "formatted_title=$formatted_title" >> $GITHUB_ENV + - name: Get Latest Tag + id: get_tag + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "tag=${latest_tag}" >> $GITHUB_ENV - name: Bump Patch Version id: bump uses: cbrgm/semver-bump-action@main with: - current-version: ${{ steps.get_tag.outputs.tag }} + current-version: ${{ env.tag }} bump-level: patch + - name: Create a new tag run: | git tag ${{ steps.bump.outputs.new_version }} -m "${{ steps.get_pr_title.outputs.pr_title }}" From 0a75417539cd0958c612f6795fb5ff03e5af081f Mon Sep 17 00:00:00 2001 From: greensd4 Date: Mon, 26 Aug 2024 12:38:30 +0300 Subject: [PATCH 3/3] changes --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04fdf2c..501a4a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,11 @@ jobs: exit 1 fi echo "formatted_title=$formatted_title" >> $GITHUB_ENV + - name: Get Latest Tag + id: get_tag + run: | + latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`) + echo "tag=${latest_tag}" >> $GITHUB_ENV - name: Bump Patch Version id: bump uses: cbrgm/semver-bump-action@main