Skip to content

Commit

Permalink
Fix the release workflow upgrade check (#480)
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <jamiehalebc@gmail.com>
  • Loading branch information
jamshale authored May 21, 2024
1 parent 03109c3 commit b5baf83
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,18 @@ jobs:
}
for file in ${get_changed_files}; do
if [[ $file == *"/poetry.lock"* ]] && [[ $file != *"integration/poetry.lock"* ]]; then
lock_version=$(grep -A1 'name = "aries-cloudagent"' $file | grep -v 'name = "aries-cloudagent"')
version=$(grep -oP '(?<=").*?(?=")' <<< "$lock_version")
echo "Version = $version"
number_of_slashes=$(grep -o "/" <<< "$file" | wc -l)
# Check if the lock file is rooted
if [[ $file == *"/poetry.lock"* ]] && [[ "$number_of_slashes" == 1 ]]; then
changes="$(git diff ${{ github.event.before }} ${{ github.event.after }} $file)"
lock_version=$(echo "$changes" | grep -A1 'name = "aries-cloudagent"' | head -n 2 | tail -n 1 | awk '{print $3}' | tr -d '"')
echo "File = $file"
echo "Old Version = $lock_version"
echo "Global Version = $current_global_version"
if [[ $(sem_version $current_global_version) -ge $(sem_version $version) ]]; then
echo "Upgrade Detected for $plugin in file $file"
if [[ "$lock_version" ]] && [[ $(sem_version $current_global_version) -gt $(sem_version $lock_version) ]]; then
echo "Upgrade Detected in $file"
found_upgrade=true
break
fi
fi
done
Expand Down

0 comments on commit b5baf83

Please sign in to comment.