Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github build-push-action@v2 with Private submodule fails. #646

Closed
vishalsinhgadhvi opened this issue Jul 1, 2022 · 1 comment
Closed

Comments

@vishalsinhgadhvi
Copy link

Troubleshooting

The github action "checkout" works fine on a private submodule when we pass the github token alongside. But the docker build-push-action fails with an error even though we pass the github token.

"git@github.com: Permission denied (publickey).
#1 1.420 fatal: Could not read from remote repository.
#1 1.420
#1 1.420 Please make sure you have the correct access rights
#1 1.420 and the repository exists."

Behaviour

The build-push-action fails with an error.

Steps to reproduce this issue

  1. Create a submodule with a private repository.
  2. Try the build-push-action by passing github token for authentication.

Expected behaviour

Build push action should either authenticate the cloning of a private repository (submodule), or at the first stage when we are already doing the git submodule checkout then why is build-push-action again doing the same and failing.

      - name: Checkout private submodule repo
        uses: actions/checkout@v3
        with:
          repository: organization/private repo
          path: my repo 
          token: ${{ env.gh_token }}
        
      - name: Run build
        run: git submodule update --remote --merge

      - name: Docker Push
        uses: docker/build-push-action@v2
        with:
          appname: ${{ env.APP_NAME }}
          appid: ${{ env.APP_ID }}
          tag: ${{ needs.Git_Tag.outputs.tag }}
          dockerfile_path: Dockerfile
          registry: quay.io
          quay_username: ${{ env.quay_username }}
          quay_password: ${{ env.quay_password }}
          image_registry: ${{ env.image_registry }}
          jfrog_username: ${{ env.jfrog_username }}
          jfrog_password: ${{ env.jfrog_password }}
          gh_token: ${{ env.gh_token }}
@crazy-max
Copy link
Member

@vishalsinhgadhvi

      - name: Docker Push
        uses: docker/build-push-action@v2
        with:
          appname: ${{ env.APP_NAME }}
          appid: ${{ env.APP_ID }}
          tag: ${{ needs.Git_Tag.outputs.tag }}
          dockerfile_path: Dockerfile
          registry: quay.io
          quay_username: ${{ env.quay_username }}
          quay_password: ${{ env.quay_password }}
          image_registry: ${{ env.image_registry }}
          jfrog_username: ${{ env.jfrog_username }}
          jfrog_password: ${{ env.jfrog_password }}
          gh_token: ${{ env.gh_token }}

None of these inputs exist for this action. Please review your workflow: https://github.com/docker/build-push-action/#inputs

If you want to build with a Git context using a GitHub git repo, the GitHub Token does not need to be passed as explained in the README. You also don't need the "Checkout" step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants