fix(ci): resolve image name from $GITHUB_REPOSITORY, not repository.name

The weekly cron build failed at "Build & push":
  invalid tag "192.168.0.2:1234/justin/:2026.08.03": invalid reference format

github.event.repository.name is EMPTY on schedule events in Gitea (only
workflow_dispatch populates the event payload), so the image tag collapsed
to ".../justin/:<tag>" → invalid → build failed. That's why manual dispatch
refreshes passed while every weekly cron run failed — and since scrape →
index → commit all run before the build, the corpus kept updating on main
each week but the image never shipped.

Fix (mirrors morpheus-docs PR #7):
  - Add a "Resolve repo identity" step deriving owner/name from
    $GITHUB_REPOSITORY (set on ALL event types).
  - Repoint all 7 refs per file (image name, 2 OCI labels, package-link
    OWNER/PKG, prune --owner/--package) to steps.repo.outputs.{owner,name}.
  - Drop the now-unused IMAGE env.
  - Same fix applied to image-only.yml (dispatch-only, so not failing today,
    but the same latent footgun).

Verified: YAML valid; no github.event.repository.name template refs remain.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MNQRS6F7N9Uwh1SMn3xz2g
This commit is contained in:
2026-08-06 11:00:38 -04:00
co-authored by Claude Opus 4.8
parent ceba897d03
commit 10cb75e461
2 changed files with 41 additions and 18 deletions
+19 -8
View File
@@ -18,7 +18,9 @@ env:
# body cap. PULL uses the public hostname (HTTPS). Same Gitea registry.
REGISTRY_PUSH: 192.168.0.2:1234
REGISTRY_PULL: git.jpaul.io
IMAGE: ${{ github.repository_owner }}/${{ github.event.repository.name }}
# Image name resolved at runtime from $GITHUB_REPOSITORY (see the "Resolve
# repo identity" step). github.event.repository.name is empty on non-
# workflow_dispatch events in Gitea, so it's avoided (matches refresh.yml).
# Two GPU-pinned Ollama containers on the Gitea host — same infra
# zerto-docs uses. :11435 = Titan X, :11436 = 1080 Ti. Indexer
# round-robins per batch.
@@ -38,6 +40,15 @@ jobs:
# Full history so digest-history can walk git log.
fetch-depth: 0
# Derive owner/repo from $GITHUB_REPOSITORY (set on all event types),
# not github.event.repository.name (empty on non-dispatch events).
- name: Resolve repo identity
id: repo
run: |
echo "owner=${GITHUB_REPOSITORY%%/*}" >> "$GITHUB_OUTPUT"
echo "name=${GITHUB_REPOSITORY##*/}" >> "$GITHUB_OUTPUT"
echo "resolved repo identity: ${GITHUB_REPOSITORY}"
- name: Set up Python
uses: actions/setup-python@v5
with:
@@ -95,14 +106,14 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: 192.168.0.2:1234/${{ github.repository_owner }}/${{ github.event.repository.name }}
images: 192.168.0.2:1234/${{ steps.repo.outputs.owner }}/${{ steps.repo.outputs.name }}
tags: |
type=raw,value=latest
type=sha,prefix=,format=short
type=raw,value={{date 'YYYY.MM.DD'}}
labels: |
org.opencontainers.image.source=https://git.jpaul.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
org.opencontainers.image.url=https://git.jpaul.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
org.opencontainers.image.source=https://git.jpaul.io/${{ steps.repo.outputs.owner }}/${{ steps.repo.outputs.name }}
org.opencontainers.image.url=https://git.jpaul.io/${{ steps.repo.outputs.owner }}/${{ steps.repo.outputs.name }}
- name: Build & push (amd64)
uses: docker/build-push-action@v6
@@ -117,8 +128,8 @@ jobs:
env:
GITEA_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
OWNER="${{ github.repository_owner }}"
PKG="${{ github.event.repository.name }}"
OWNER="${{ steps.repo.outputs.owner }}"
PKG="${{ steps.repo.outputs.name }}"
code=$(curl -s -o /tmp/link.out -w "%{http_code}" -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
"https://git.jpaul.io/api/v1/packages/${OWNER}/container/${PKG}/-/link/${PKG}")
@@ -135,7 +146,7 @@ jobs:
GITEA_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
python scripts/registry_gc.py \
--owner "${{ github.repository_owner }}" \
--package "${{ github.event.repository.name }}" \
--owner "${{ steps.repo.outputs.owner }}" \
--package "${{ steps.repo.outputs.name }}" \
--keep-days 90 \
--keep-latest 5