mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
Resolve merge conflicts, keep the cleanup script move to scripts/image, and fix the resulting lint regressions.
28 lines
644 B
Bash
Executable File
28 lines
644 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ -n "${INFINITO_IMAGE_REPOSITORY:-}" ]]; then
|
|
printf '%s\n' "${INFINITO_IMAGE_REPOSITORY,,}"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ -n "${REPO_PREFIX:-}" ]]; then
|
|
printf '%s\n' "${REPO_PREFIX,,}"
|
|
exit 0
|
|
fi
|
|
|
|
if [[ -n "${GITHUB_REPOSITORY:-}" ]]; then
|
|
repo_name="${GITHUB_REPOSITORY#*/}"
|
|
printf '%s\n' "${repo_name,,}"
|
|
exit 0
|
|
fi
|
|
|
|
if git_root="$(git rev-parse --show-toplevel 2>/dev/null)"; then
|
|
repo_name="$(basename "${git_root}")"
|
|
printf '%s\n' "${repo_name,,}"
|
|
exit 0
|
|
fi
|
|
|
|
echo "ERROR: Could not resolve repository name from INFINITO_IMAGE_REPOSITORY, REPO_PREFIX, GITHUB_REPOSITORY or git metadata." >&2
|
|
exit 1
|