terraform-providers: skip updating spdx if null

This commit is contained in:
zowoq
2023-06-16 15:57:48 +10:00
parent 9bfaad424a
commit 4b5f5fff36
@@ -136,8 +136,11 @@ repo="$(echo "${provider_source_url}" | cut -d '/' -f 5)"
update_attr repo "${repo}"
if [[ ${spdx} == 1 ]]; then
spdx="$(curl -L -s ${GITHUB_TOKEN:+-u ":${GITHUB_TOKEN}"} "https://api.github.com/repos/${org}/${repo}/license" | jq -r '.license.spdx_id')"
update_attr spdx "${spdx}"
old_spdx="$(read_attr spdx)"
if [[ ${old_spdx} != null ]]; then
spdx="$(curl -L -s ${GITHUB_TOKEN:+-u ":${GITHUB_TOKEN}"} "https://api.github.com/repos/${org}/${repo}/license" | jq -r '.license.spdx_id')"
update_attr spdx "${spdx}"
fi
fi
echo_provider "calculating hash"