Avoid Renovate preflight failure on missing read:user scope
Some checks failed
CICD / Build and Publish CICD Base Image (push) Successful in 21s
CICD / Build and Push CICD Image (push) Successful in 17m58s
CICD / Build CICD Image Failure Postmortem (push) Has been skipped
CICD / Build Frontend Main Image (push) Has been cancelled
CICD / CICD Tests Complete (push) Has been cancelled
CICD / Build Backend Base Image (push) Has been cancelled
CICD / Build Frontend Base Image (push) Has been cancelled
CICD / Build Integration Tester Image (push) Has been cancelled
CICD / Build E2E Tester Image (push) Has been cancelled
CICD / Build Backend Main Image (push) Has been cancelled
CICD / Backend Tests (push) Has started running
CICD / Pre-commit Checks (push) Has started running
CICD / Production Images Complete (push) Has been cancelled
CICD / Production Image Failures Postmortem (push) Has been cancelled
CICD / Source Lanes Failure Postmortem (push) Has been cancelled
CICD / Runtime Black-Box Integration Tests (push) Has been cancelled
CICD / Integration Tests Failure Postmortem (push) Has been cancelled
CICD / End-to-End Tests (push) Has been cancelled
CICD / E2E Tests Failure Postmortem (push) Has been cancelled
CICD / Frontend Tests (push) Has been cancelled
CICD / Backend Doctests (push) Has been cancelled

This commit is contained in:
copilotcoder
2026-07-10 09:42:06 -04:00
parent d0802f70c9
commit 85960e3599

View File

@@ -253,10 +253,11 @@ jobs:
# shellcheck disable=SC2086
docker run --rm ${DOCKER_ADD_HOST_ARG} \
-e API_ENDPOINT="${API_ENDPOINT}" \
-e TARGET_REPO="${TARGET_REPO}" \
-e RENOVATE_TOKEN \
-e NODE_TLS_REJECT_UNAUTHORIZED \
"${RENOVATE_IMAGE}" \
node -e 'const endpoints = [["version", `${process.env.API_ENDPOINT}/version`, {}], ["user", `${process.env.API_ENDPOINT}/user`, { headers: { Authorization: `token ${process.env.RENOVATE_TOKEN}` } }]]; let failed = false; (async () => { for (const [name, url, options] of endpoints) { try { const response = await fetch(url, options); console.log(`container_${name}_status=${response.status}`); if (!response.ok) { failed = true; console.log(`container_${name}_body_start`); console.log((await response.text()).slice(0, 1000)); console.log(`container_${name}_body_end`); } } catch (error) { failed = true; console.log(`container_${name}_error=${error instanceof Error ? error.message : String(error)}`); } } if (failed) { process.exit(1); } })();'
node -e 'const endpoints = [["version", `${process.env.API_ENDPOINT}/version`, {}], ["repo", `${process.env.API_ENDPOINT}/repos/${process.env.TARGET_REPO}`, { headers: { Authorization: `token ${process.env.RENOVATE_TOKEN}` } }], ["user", `${process.env.API_ENDPOINT}/user`, { headers: { Authorization: `token ${process.env.RENOVATE_TOKEN}` }, optional: true }]]; let failed = false; (async () => { for (const [name, url, rawOptions] of endpoints) { const optional = Boolean(rawOptions.optional); const options = { ...rawOptions }; delete options.optional; try { const response = await fetch(url, options); console.log(`container_${name}_status=${response.status}`); if (!response.ok && !optional) { failed = true; console.log(`container_${name}_body_start`); console.log((await response.text()).slice(0, 1000)); console.log(`container_${name}_body_end`); } else if (!response.ok && optional) { console.log(`container_${name}_optional_scope_missing=true`); } } catch (error) { if (!optional) { failed = true; console.log(`container_${name}_error=${error instanceof Error ? error.message : String(error)}`); } else { console.log(`container_${name}_optional_probe_error=${error instanceof Error ? error.message : String(error)}`); } } } if (failed) { process.exit(1); } })();'
# Run Renovate with configuration
if [ "${RENOVATE_DRY_RUN}" = "true" ]; then