Skip to content

Commit

Permalink
Merge pull request #519 from blacklanternsecurity/change-tag-behavior
Browse files Browse the repository at this point in the history
fixing pipelines
  • Loading branch information
liquidsec authored Nov 8, 2024
2 parents 1ef5afe + 39901da commit 2eda85e
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,29 @@ jobs:
- name: Get current version from Poetry
id: get_version
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV

run: |
VERSION=$(poetry version --short)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Fetch latest tag
run: |
git fetch --tags
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
- name: Check for major or minor version change
id: check_major_minor_version
run: |
CURRENT_VERSION=${{ env.VERSION }}
LATEST_VERSION=${{ env.LATEST_TAG }}
# Retrieve and strip "v" prefix if present
CURRENT_VERSION="${{ env.VERSION }}"
LATEST_VERSION="${{ env.LATEST_TAG }}"
CURRENT_VERSION="${CURRENT_VERSION#v}"
LATEST_VERSION="${LATEST_VERSION#v}"
# Extract major.minor for comparison
CURRENT_MAJOR_MINOR=$(echo $CURRENT_VERSION | cut -d '.' -f 1-2)
LATEST_MAJOR_MINOR=$(echo $LATEST_VERSION | cut -d '.' -f 1-2)
CURRENT_MAJOR_MINOR=$(echo "$CURRENT_VERSION" | cut -d '.' -f 1-2)
LATEST_MAJOR_MINOR=$(echo "$LATEST_VERSION" | cut -d '.' -f 1-2)
if [ "$CURRENT_MAJOR_MINOR" == "$LATEST_MAJOR_MINOR" ]; then
echo "VERSION_CHANGE=false" >> $GITHUB_ENV
else
Expand Down

0 comments on commit 2eda85e

Please sign in to comment.