Skip to content

Commit

Permalink
build: add conditional noop
Browse files Browse the repository at this point in the history
  • Loading branch information
t03i committed Nov 10, 2024
1 parent eea1a56 commit 4289bda
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/release-needed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ echo "----------------------------------------"
# Function to run semantic-release command with common parameters
run_semantic_release() {
local args=$1
uv tool run --from python-semantic-release semantic-release --noop -c releaserc.toml $args 2>/dev/null || true
local noop=${2:-}
local cmd="uv tool run --from python-semantic-release semantic-release -c releaserc.toml $args"
if [ -n "$noop" ]; then
cmd="$cmd --noop"
fi
$cmd 2>/dev/null || true
}

echo "1️⃣ Getting current tag (would-be release)..."
current_tag=$(run_semantic_release "version --print-tag")
echo " Current tag would be: '$current_tag'"

echo "2️⃣ Getting last released tag..."
last_tag=$(run_semantic_release "version --print-last-released-tag")
last_tag=$(run_semantic_release "version --print-last-released-tag" "true")
echo " Last released tag was: '$last_tag'"

echo "----------------------------------------"
Expand Down

0 comments on commit 4289bda

Please sign in to comment.