Skip to content

use git+ssh for use with private repo #316

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

hparfr
Copy link

@hparfr hparfr commented Mar 11, 2025

Still experimental

I need to access private github repo.

In https://github.com/OCA/oca-github-bot/blob/master/src/oca_github_bot/github.py

    repo_url = f"https://github.com/{org}/{repo}"
    repo_url_with_token = f"https://{config.GITHUB_TOKEN}@github.com/{org}/{repo}"
    # fetch all branches into cache
    fetch_cmd = [
        "git",
        "fetch",
        "--quiet",
        "--force",
        "--prune",
        repo_url,
        "refs/heads/*:refs/heads/*",
    ]

for git fetch repo_url is used instead of repo_url_with_token; I'm not sure if the repo_url is displayed in case of error messages.

Using ssh protocol instead of http is easier to use in my case.

It's working but at the moment half finished.

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

Successfully merging this pull request may close these issues.

1 participant