Normalize registry token secret
This commit is contained in:
@@ -81,6 +81,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
auth_token="$(printf '%s' "${REGISTRY_TOKEN}" | sed -E 's/^(token|Bearer)[[:space:]]+//; s/[[:space:]]+$//')"
|
||||
package_version="${APP_VERSION}-${GITHUB_SHA::7}"
|
||||
package_dir="package-registry"
|
||||
mkdir -p "${package_dir}/versioned" "${package_dir}/latest"
|
||||
@@ -96,20 +97,20 @@ jobs:
|
||||
cp "${artifact}" "${package_dir}/latest/${LATEST_FILE}"
|
||||
|
||||
curl --fail-with-body \
|
||||
--header "Authorization: token ${REGISTRY_TOKEN}" \
|
||||
--header "Authorization: token ${auth_token}" \
|
||||
--upload-file "${package_dir}/versioned/${versioned_file}" \
|
||||
"https://git.wilkensxl.de/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/${package_version}/${versioned_file}"
|
||||
|
||||
curl --silent --show-error \
|
||||
--header "Authorization: token ${REGISTRY_TOKEN}" \
|
||||
--header "Authorization: token ${auth_token}" \
|
||||
--request DELETE \
|
||||
"https://git.wilkensxl.de/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/latest" || true
|
||||
|
||||
curl --fail-with-body \
|
||||
--header "Authorization: token ${REGISTRY_TOKEN}" \
|
||||
--header "Authorization: token ${auth_token}" \
|
||||
--upload-file "${package_dir}/latest/${LATEST_FILE}" \
|
||||
"https://git.wilkensxl.de/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/latest/${LATEST_FILE}"
|
||||
|
||||
curl --fail --head \
|
||||
--header "Authorization: token ${REGISTRY_TOKEN}" \
|
||||
--header "Authorization: token ${auth_token}" \
|
||||
"https://git.wilkensxl.de/api/packages/${PACKAGE_OWNER}/generic/${PACKAGE_NAME}/latest/${LATEST_FILE}"
|
||||
|
||||
Reference in New Issue
Block a user