:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(cd): stop passing the ECR repository through job outputs (#81205)
Stephen Schmidt0f6d8eac7166
diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.ymlindex 610441185a47..fceb0b8fe116 100644--- a/.github/workflows/container-images-cd.yml+++ b/.github/workflows/container-images-cd.yml@@ -31,13 +31,17 @@ concurrency:group: ${{ github.workflow }}-${{ github.sha }}cancel-in-progress: false+# ECR_REPOSITORY is workflow-level so ordered_image_alias reads it directly instead of+# through a job output: the runner refuses to export job outputs whose value contains a+# masked secret, and this value matches one, so a cross-job output of it arrives empty.+env:+ ECR_REPOSITORY: posthog-cloud+jobs:posthog_build:name: Build and push PostHogoutputs:image-digest: ${{ steps.image.outputs.digest }}- ecr-registry: ${{ steps.docker-meta.outputs.ecr-registry }}- ecr-repository: ${{ steps.ecr-repository.outputs.name }}# Production build/deploy runs only from the canonical deploy repo (CD_DEPLOY_ENABLED).if: github.repository_owner == 'PostHog' && vars.CD_DEPLOY_ENABLED == 'true'runs-on: depot-ubuntu-24.04@@ -47,8 +51,6 @@ jobs:id-token: write # allow issuing OIDC tokens for this workflow runcontents: read # allow at least reading the repo contents, add other permissions if necessarypackages: write # allow push to ghcr.io- env:- ECR_REPOSITORY: posthog-cloudsteps:- name: Check out@@ -62,12 +64,6 @@ jobs:- name: Set up Depot CLIuses: depot/setup-action@15c09a5f77a0840ad4bce955686522a257853461 # v1.7.1- - name: Expose ECR repository- id: ecr-repository- shell: bash- run: |- echo "name=${ECR_REPOSITORY:?ECR_REPOSITORY is unset}" >> "$GITHUB_OUTPUT"-- name: Docker meta and registry loginid: docker-metauses: ./.github/actions/docker-meta@@ -1254,6 +1250,7 @@ jobs:- name: Log in to Amazon ECR for ordered image aliasif: ${{ steps.ordered-release.outputs.tag != '' }}+ id: ecr-loginuses: aws-actions/amazon-ecr-login@f2e9fc6c2b355c1890b65e6f6f0e2ac3e6e22f78 # v2.1.2- name: Publish and read back ordered image alias@@ -1261,8 +1258,8 @@ jobs:timeout-minutes: 2shell: bashenv:- ECR_REGISTRY: ${{ needs.posthog_build.outputs.ecr-registry }}- ECR_REPO: ${{ needs.posthog_build.outputs.ecr-repository }}+ ECR_REGISTRY: ${{ steps.ecr-login.outputs.registry }}+ ECR_REPO: ${{ env.ECR_REPOSITORY }}EXPECTED_DIGEST: ${{ needs.posthog_build.outputs.image-digest }}ORDERED_ALIAS: ${{ steps.ordered-release.outputs.tag }}run: |@@ -1273,6 +1270,11 @@ jobs:exit 0fi+ if [ -z "$ECR_REGISTRY" ] || [ -z "$ECR_REPO" ]; then+ echo "::warning title=Ordered image alias destination unavailable::Ordered image alias publication was skipped because the ECR registry or repository name resolved empty."+ exit 0+ fi+SOURCE_IMAGE="${ECR_REGISTRY}/${ECR_REPO}@${EXPECTED_DIGEST}"TARGET_IMAGE="${ECR_REGISTRY}/${ECR_REPO}:${ORDERED_ALIAS}"