mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
act fills the GITHUB_REPOSITORY* vars with its own placeholders, so the existing owner guard passes and the resolver hands back ghcr.io/nektos/act/ <distro>. That path does not exist and the swarm node build died on a 403 three minutes into every local run. Returning nothing is what the callers already treat as 'build it locally'. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Resolve the prebuilt CI environment image for the current distro.
|
|
#
|
|
# Param:
|
|
# INFINITO_DISTRO distro to resolve for
|
|
# INFINITO_IMAGE_TAG tag the CI images were pushed under
|
|
# INFINITO_IMAGE_REPOSITORY repository name; resolve/repository/name.sh falls back to git metadata when empty
|
|
#
|
|
# Output: the image reference, or nothing when no registry owner is in scope,
|
|
# which is the caller's signal to build the image locally instead.
|
|
#
|
|
# act sets the GITHUB_REPOSITORY* vars to placeholders (nektos/act), so the
|
|
# owner guard below passes and the resolved path 403s on ghcr.io.
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../.." && pwd)"
|
|
cd "${REPO_ROOT}"
|
|
|
|
if [[ "${ACT:-}" == "true" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
if [[ -z "${OWNER:-}" && -z "${GITHUB_REPOSITORY_OWNER:-}" && -z "${GITHUB_REPOSITORY:-}" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
: "${INFINITO_DISTRO:?INFINITO_DISTRO is required}"
|
|
: "${INFINITO_IMAGE_TAG:?INFINITO_IMAGE_TAG is required}"
|
|
|
|
python3 -m cli.meta.ci.image_ref --kind environment \
|
|
--distro "${INFINITO_DISTRO}" \
|
|
--owner "$(scripts/meta/resolve/repository/owner.sh)" \
|
|
--repository "$(scripts/meta/resolve/repository/name.sh)" \
|
|
--tag "${INFINITO_IMAGE_TAG}"
|