Skip to content

Commit

Permalink
Update cut_release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tyuchn authored Oct 25, 2023
1 parent a5fb525 commit cf1929c
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/cut_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ jobs:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- name: Filter tags
id: filter_tags
- name: Get the latest tag
id: get-latest-tag
run: |
# Define the major and minor version you're interested in
major_minor_version="1.3"
LATEST_TAG=$(git describe --tags --match "v1.3.*" --abbrev=0)
echo "::set-output name=latest_tag::$LATEST_TAG"
# Get the latest tag that matches the major and minor version
latest_tag=""
for tag in ${{ steps.get_latest_tag.outputs.tags }}; do
if [[ "$tag" == "v${major_minor_version}."* ]]; then
latest_tag="$tag"
break
fi
done
- name: Get the latest patch version
id: get-latest-patch
run: |
LATEST_TAG=${{ steps.get-latest-tag.outputs.latest_tag }}
LATEST_PATCH_VERSION=$(echo $LATEST_TAG | sed 's/v1.3.//')
echo "::set-output name=latest_patch_version::$LATEST_PATCH_VERSION"
echo "Latest tag for $major_minor_version: $latest_tag"
echo "::set-output name=latest_tag::$latest_tag"
shell: bash
- name: Output Latest Patch Version
run: echo "Latest patch version is ${{ steps.get-latest-patch.outputs.latest_patch_version }}"

- name: Bump version and push tag
id: bump_version_and_push_tag
Expand Down

0 comments on commit cf1929c

Please sign in to comment.