Update tools/update-scan

Co-authored-by: CvH <1355173+CvH@users.noreply.github.com>
This commit is contained in:
Rudi Heitbaum 2023-07-17 07:49:12 +10:00 committed by GitHub
parent ea747fa19f
commit 8b54768614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,9 +72,9 @@ check_for_update() {
esac
# if pkg_version is a githash on github and github api available - always check against latest
if [[ ${PKG_VERSION} =~ ^[a-z0-9]{40} ]] && \
[[ ${PKG_URL} =~ ^.*(github\.com).*$ ]] && \
[[ "${github_api}" = "yes" ]]; then
if [[ ${PKG_VERSION} =~ ^[a-z0-9]{40} ]] &&
[[ ${PKG_URL} =~ ^.*(github\.com).*$ ]] &&
[[ "${github_api}" = "yes" ]]; then
github_repos=$(echo "${PKG_URL}" | grep -oP '(?<=https:\/\/github.com\/)?[0-9A-Za-z._-]+\/[0-9A-Za-z._-]+(?=/archive|/tags|/releases)')
le_master_version_date="Commit date: $(curl -sL ${github_api_token} https://api.github.com/repos/${github_repos}/git/commits/${PKG_VERSION} | jq -r '.committer.date')"