Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CM000n committed Dec 14, 2023
1 parent 334d32e commit 1b21ecf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/check-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,17 @@ jobs:
exit 1
fi
current_dependencies=$(poetry show --only main | awk '{print $1}')
current_dependencies=$(poetry show --only main --format=json | jq -r '.default.dependencies')
manifest_dependencies=$(jq -r '.requirements[]' custom_components/qss/manifest.json)
for dependency in $manifest_dependencies; do
if ! echo "$current_dependencies" | grep -q "$dependency"; then
poetry_version_spec=$(poetry show --only main --format=json "$dependency" | jq -r '.version')
normalized_poetry_version_spec=$(awk '{ sub(/[\^~>=]/, "", $0); print }' <<<"$poetry_version_spec")
normalized_manifest_dependency=$(sed 's/=.*,/>=/' <<<"$dependency")
if ! poetry show --only main --format=json "$normalized_manifest_dependency" &>/dev/null; then
echo "Error: Missing dependency $dependency in pyproject.toml"
exit 1
elif ! [[ "$normalized_manifest_dependency" =~ $normalized_poetry_version_spec ]]; then
echo "Error: Version mismatch between pyproject.toml ($poetry_version_spec) and manifest.json ($dependency)"
exit 1
fi
done

0 comments on commit 1b21ecf

Please sign in to comment.