Skip to content

Commit

Permalink
new script for version bumps
Browse files Browse the repository at this point in the history
gpmayorga committed Dec 19, 2024
1 parent d43adff commit 96fdaab
Showing 3 changed files with 36 additions and 70 deletions.
40 changes: 0 additions & 40 deletions .github/ci-scripts/check-version-bump.sh

This file was deleted.

36 changes: 36 additions & 0 deletions .github/ci-scripts/pr-label-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Function to check if a specific label exists in the list
contains_label() {
local label="$1"
shift
for item in "$@"; do
if [[ "$item" == "$label" ]]; then
return 0
fi
done
return 1
}

# Fetch the most recent merged PR number
LAST_PR_NUMBER=$(gh pr list --state merged --json number --jq '.[0].number')

# Fetch the labels of the PR
labels=$(gh pr view "$LAST_PR_NUMBER" --json labels --jq '.labels[].name')

# Convert labels to an array
IFS=$'\n' read -rd '' -a label_array <<<"$labels"

# List of labels to check
LABELS_TO_CHECK=("major" "minor" "patch" "no-release" "alpha")

# Check for the specified labels
for label in "${LABELS_TO_CHECK[@]}"; do
if contains_label "$label" "${label_array[@]}"; then
echo "$label"
exit 0
fi
done

# If no specified label is found, return 'no-release'
echo "no-release"
30 changes: 0 additions & 30 deletions .github/ci-scripts/toggle-alpha.sh

This file was deleted.

0 comments on commit 96fdaab

Please sign in to comment.