docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.11k stars 526 forks source link

Issue with git clone when the repo include submodules from other repositories #1089

Closed or-he-MA closed 3 months ago

or-he-MA commented 3 months ago

Description

We have some submodules in our repo, that points to some other repositories. Since the first stage of the build-push-action is to checkout the current repo, it keeps failing with the error:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

When using the the checkout action (https://github.com/actions/checkout) we can overcome it using the submodules option, for example:

      - name: "Checkout current repo"
        uses: actions/checkout@v4
        with:
          submodules: recursive

So if i could control wether to checkout the repo and disable it, or the other hand have the option to overcome the submodules, it would be great. Since right now our workflow is failing due to that issue.

crazy-max commented 3 months ago

Seems a duplicate of https://github.com/docker/build-push-action/issues/638

or-he-MA commented 3 months ago

@crazy-max You are right. Didn't noticed it. The question is if there is an option to add the ability to disable the default checkout that is currently happening using the build-push-action.

If needed we can close this thread and i'll comment on https://github.com/docker/build-push-action/issues/638

crazy-max commented 3 months ago

Yes you can workaround it using the Path context as shown in https://github.com/docker/build-push-action/issues/638#issuecomment-1268196131

I'm closing this issue, let's continue the convo in #638