okteto / pipeline

Enable GitHub developers to trigger Okteto Pipelines from a GitHub Actions workflow
https://okteto.com
Apache License 2.0
15 stars 8 forks source link

Error while using with private repos #5

Closed mahendraHegde closed 3 years ago

mahendraHegde commented 3 years ago

I see following error in Okteto dashboard when try to deploy using this workflow

Cloning git repository 'https://***@github.com/mahendraHegde/project' branch 'test-t'...
Cloning into '/okteto/src'...
warning: Could not find remote branch test-t to clone.
fatal: Remote branch test-t not found in upstream origin
failed to clone repository with URL 'https://***@github.com/mahendraHegde/project'
falling back to 'ssh://git@github.com/mahendraHegde/project'....
Cloning git repository 'ssh://git@github.com/mahendraHegde/project' branch 'test-t'...
Cloning into '/okteto/src'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights

Here's my workflow.yaml

on: [push]

name: okteto

jobs:
  preview:
    runs-on: ubuntu-latest
    steps:
    - name: checkout
      uses: actions/checkout@master

    - name: Login
      uses: okteto/login@master
      with:
        token: ${{ secrets.OKTETO_TOKEN }}

    - name: Deploy Application
      uses: okteto/pipeline@master
      with:
        namespace: mahendrahegde
        timeout: 10m
        name: okteto-pipeline.yaml

I have linked GitHub with Okteto and allowed private repo access. I can deploy the same branch using Okteto dashboard/UI.

rberrelleza commented 3 years ago

@mahendraHegde was this on Okteto Cloud, of using your own installation of Okteto Enterprise?

mahendraHegde commented 3 years ago

@rberrelleza it was on Okteto cloud.

ifbyol commented 3 years ago

Hi! @mahendraHegde , I was able to reproduce the issue and I want to confirm my theory. Is test-t the name of the branch or is <something>/test-t? Thanks in advance!

mahendraHegde commented 3 years ago

@ifbyol test-t is the name of the branch

ifbyol commented 3 years ago

@mahendraHegde thanks for the information! So it is not the same issue I had, I have discovered we have an issue with branches containing a /, but it seems it is not your case.

According to the logs you provided, git client is reporting that the branch doesn't exist in the origin. Would you mind to share with us the log of the actions being executed? At least we would need logs for actions/checkout and okteto/pipeline actions to check if there was any possible error on those executions that may cause the issue. Those logs can be found on the Actions section of your repository.

In the meantime, we are trying to reproduce the issue. Thanks in advance!

mahendraHegde commented 3 years ago

@ifbyol sorry for misleading. my branch had a / in it, it was feat/test-t. So your fix should solve my issue. plz let me know once merged and published.

ifbyol commented 3 years ago

Hi @mahendraHegde ! No worries, we just have merged and published the fix, so the issue should be solved. Let us know if the problem persists. Thanks for report the issue!