From b20d29bded0056fa68f0c70ca4517c60c8a4f821 Mon Sep 17 00:00:00 2001 From: evolution Date: Tue, 21 Apr 2026 01:20:57 +0800 Subject: [PATCH] fix(docker): use inputs.tag to detect workflow_call context (#996) In a reusable workflow, github.event_name inherits the caller's event (e.g. "push"), not "workflow_call". This caused the type=raw tag to be disabled when docker.yml was called from release-candidate.yml, producing no Docker tags at all and failing the build. Fix: check `inputs.tag != ''` instead, since inputs.tag is only populated for workflow_call invocations. Co-authored-by: wangjichao --- .github/workflows/docker.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b83a1e4ba..7cd8b678ce 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -135,6 +135,9 @@ jobs: # the type=semver patterns would not match. In that case we add an explicit # type=raw tag using the version already verified above, so the same # image-naming rules apply regardless of how the workflow was triggered. + # NOTE: We check `inputs.tag` rather than `github.event_name` because in a + # reusable workflow the github context is inherited from the caller — + # `github.event_name` would still be "push", not "workflow_call". - name: Extract Docker metadata id: meta uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0 @@ -145,7 +148,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} - type=raw,value=${{ steps.version.outputs.version }},enable=${{ github.event_name == 'workflow_call' }} + type=raw,value=${{ steps.version.outputs.version }},enable=${{ inputs.tag != '' }} - name: Build and push id: build