Skip to content

Commit c564e9d

Browse files
d-csclaude
andcommitted
ci: DRY the registry expression with a YAML anchor
Define the registry-resolution expression once on publish-webapp via a YAML anchor (&image_registry) and reuse it in the worker jobs via aliases (*image_registry). GitHub Actions has supported YAML anchors since 2025-09-18, so this gives a single source of truth without the runner startup cost of a dedicated resolve job. Resolved value is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent beb5391 commit c564e9d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ jobs:
7474
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
7575
with:
7676
image_tag: ${{ inputs.image_tag }}
77-
# Target registry namespace, resolved once here and passed to every publish
78-
# job. Defaults to ghcr.io/<owner> so a fork publishes to its own namespace;
79-
# set the IMAGE_REGISTRY repository variable to override.
80-
image_registry: ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
77+
# Target registry namespace, defined once here (via a YAML anchor) and reused
78+
# by every publish job. Defaults to ghcr.io/<owner> so a fork publishes to its
79+
# own namespace; set the IMAGE_REGISTRY repository variable to override.
80+
image_registry: &image_registry ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
8181

8282
publish-worker:
8383
needs: [typecheck]
@@ -90,7 +90,7 @@ jobs:
9090
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
9191
with:
9292
image_tag: ${{ inputs.image_tag }}
93-
image_registry: ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
93+
image_registry: *image_registry
9494

9595
publish-worker-v4:
9696
needs: [typecheck]
@@ -101,7 +101,7 @@ jobs:
101101
uses: ./.github/workflows/publish-worker-v4.yml
102102
with:
103103
image_tag: ${{ inputs.image_tag }}
104-
image_registry: ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
104+
image_registry: *image_registry
105105

106106
# OS-level CVE scan of the image just published above. Report-only (writes to
107107
# the run summary); runs alongside the worker publishes and never blocks them.

0 commit comments

Comments
 (0)