diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2564cf782e11..d1ded0ff5413 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -130,7 +130,10 @@ jobs: docker: name: Build&Test Docker image needs: detect - if: needs.detect.outputs.python == 'true' || needs.detect.outputs.frontend == 'true' || needs.detect.outputs.docker_meta == 'true' + # Trusted main pushes run docker.yml directly so its container-publish + # environment secrets never cross this reusable-workflow call. PR runs + # remain build/test-only and secret-free. + if: needs.detect.outputs.event_name == 'pull_request' && (needs.detect.outputs.python == 'true' || needs.detect.outputs.frontend == 'true' || needs.detect.outputs.docker_meta == 'true') uses: ./.github/workflows/docker.yml supply-chain: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 16165a9e64b6..5e5c19bdf3b6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,8 +1,15 @@ name: Docker Build, Test, and Publish on: + # Trusted main pushes run this workflow directly so environment-scoped + # Docker Hub secrets are resolved by the top-level workflow, never across + # a reusable-workflow boundary. + push: + branches: [main] release: types: [published] + # CI calls this only for untrusted PR build/test coverage. Those runs never + # reach the protected publish or merge jobs below. workflow_call: permissions: