Skip to content

Commit beb5391

Browse files
d-csclaude
andcommitted
ci: resolve registry inline instead of a dedicated job
Drop the resolve-registry job to avoid its runner startup cost. GitHub doesn't expose the env context to a reusable workflow's with: block, so inline the resolution expression directly in each publish job's image_registry input instead. Behavior and upstream defaults unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2715217 commit beb5391

1 file changed

Lines changed: 9 additions & 22 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,6 @@ env:
5353
AWS_REGION: us-east-1
5454

5555
jobs:
56-
# Resolve the target container registry namespace once and pass it down to every
57-
# publish job. Defaults to ghcr.io/<owner>, so a fork publishes to its own
58-
# namespace automatically; set the IMAGE_REGISTRY repository variable to override.
59-
resolve-registry:
60-
runs-on: ubuntu-latest
61-
outputs:
62-
registry: ${{ steps.resolve.outputs.registry }}
63-
steps:
64-
- name: 🧭 Resolve target registry
65-
id: resolve
66-
env:
67-
IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY }}
68-
DEFAULT_REGISTRY: ghcr.io/${{ github.repository_owner }}
69-
run: |
70-
echo "registry=${IMAGE_REGISTRY:-$DEFAULT_REGISTRY}" >> "$GITHUB_OUTPUT"
71-
7256
typecheck:
7357
uses: ./.github/workflows/typecheck.yml
7458

@@ -79,7 +63,7 @@ jobs:
7963
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
8064

8165
publish-webapp:
82-
needs: [typecheck, resolve-registry]
66+
needs: [typecheck]
8367
permissions:
8468
contents: read
8569
packages: write
@@ -90,10 +74,13 @@ jobs:
9074
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
9175
with:
9276
image_tag: ${{ inputs.image_tag }}
93-
image_registry: ${{ needs.resolve-registry.outputs.registry }}
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) }}
9481

9582
publish-worker:
96-
needs: [typecheck, resolve-registry]
83+
needs: [typecheck]
9784
permissions:
9885
contents: read
9986
packages: write
@@ -103,18 +90,18 @@ jobs:
10390
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
10491
with:
10592
image_tag: ${{ inputs.image_tag }}
106-
image_registry: ${{ needs.resolve-registry.outputs.registry }}
93+
image_registry: ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
10794

10895
publish-worker-v4:
109-
needs: [typecheck, resolve-registry]
96+
needs: [typecheck]
11097
permissions:
11198
contents: read
11299
packages: write
113100
id-token: write
114101
uses: ./.github/workflows/publish-worker-v4.yml
115102
with:
116103
image_tag: ${{ inputs.image_tag }}
117-
image_registry: ${{ needs.resolve-registry.outputs.registry }}
104+
image_registry: ${{ vars.IMAGE_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
118105

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

0 commit comments

Comments
 (0)