diff --git a/.github/workflows/docker-build-image.yml b/.github/workflows/docker-build-image.yml index fa557cd8199..52e1b1c435c 100644 --- a/.github/workflows/docker-build-image.yml +++ b/.github/workflows/docker-build-image.yml @@ -50,7 +50,12 @@ jobs: id: name run: | echo "image_name=$(echo ${{ inputs.image-name }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT - echo "repository=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + # if pr then actor not repository owner otherwise we can not push to ghcr.io + if [ "{{ github.event_name }}" == "pull_request" ]; then + echo "repository=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + else + echo "repository=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + fi - name: set PARENT_IMAGE only if specified id: parent