terraform-providers: skip updating spdx if null
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user