Skip to content

Commit 0de5ff8

Browse files
committed
debug
1 parent b54858b commit 0de5ff8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/check-package-gate.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,23 @@ jobs:
5656
version=$(rpmspec --parse "$spec" | grep -E "^Version:\s*(.*)" | awk '{print $2}')
5757
5858
if [[ "$name" == "fdk-aac-free" || "$name" == "redis" ]]; then
59-
# get base spec if it exits.
59+
# get the previous spec if it exits.
6060
previous_spec=$(git show ${{ env.base_sha }}:"$spec" 2>/dev/null)
6161
#if the spec is a new addition, we want previous version to be empty
62-
previous_version=$(rpmspec --parse $previous_spec 2>/dev/null | grep -E "^Version:\s*(.*)" | awk '{print $2}')
62+
previous_version=""
63+
64+
if [[ -n "$previous_spec" ]]; then
65+
previous_version=$(rpmspec --parse <(git show ${{ env.base_sha }}:"$spec") | grep -E "^Version:\s*(.*)" | awk '{print $2}')
66+
fi
6367
echo "Previous version: $previous_version"
6468
if [[ "$version" != "$previous_version" ]]; then
6569
1>&2 echo "**** ERROR ****"
66-
1>&2 echo "Spec '$spec' change is not allowed in Azure Linux."
67-
1>&2 echo "**** ERROR 1****"
70+
1>&2 echo "Spec '$spec' update is not allowed in Azure Linux."
71+
1>&2 echo "**** ERROR ****"
6872
error_found=1
6973
fi
7074
fi
71-
# Check if the version is greater than or equal the allowed version
75+
# Check if the version is greater than the allowed version
7276
if { [[ "$name" == "redis" && "$(printf '%s\n' "$version" "7.4" | sort -V | head -n1)" == "7.4" ]] || \
7377
[[ "$name" == "packer" && "$(printf '%s\n' "$version" "1.10.0" | sort -V | head -n1)" == "1.10.0" ]] || \
7478
[[ "$name" == "terraform" && "$(printf '%s\n' "$version" "1.6.0" | sort -V | head -n1)" == "1.6.0" ]]; }; then

0 commit comments

Comments
 (0)