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

Cannot pull private parent repository due to missing auth in git client #44

Open
Xerkus opened this issue Dec 3, 2021 · 2 comments
Open

Comments

@Xerkus
Copy link

Xerkus commented Dec 3, 2021

🐛 Summary

Private parent repository can not be pulled because git client does not receive the token required for authentication.

To reproduce

Steps to reproduce the behavior:

  1. Setup lineage action as usual and ensure it works
  2. Make parent repository private and make sure PAT has access to the now private repository
  3. Run action

Expected behavior

Parent repository is pulled and merge branch is created

Any helpful log output or screenshots

Paste the results here:

Xerkus/public-lineage-test
  INFO Checking: Xerkus/public-lineage-test
  INFO Lineage configuration found for Xerkus/public-lineage-test
  INFO Cloning repository: https://github.com/Xerkus/public-lineage-test.git
  INFO ✅ success
  INFO Processing lineage: skeleton
  INFO Upstream: https://github.com/Xerkus/private-lineage-parent.git HEAD
  INFO Attempting to switch to branch: lineage/skeleton
  INFO ✅ (error ok) return code: 128
  INFO Branch did not exist.  Creating: lineage/skeleton from local main
  INFO Creating branch lineage/skeleton from main
  INFO ✅ success
  INFO Switching to lineage/skeleton
  INFO ✅ success
  INFO Pull request branch is new: True
  INFO Fetching https://github.com/Xerkus/private-lineage-parent.git HEAD
  Traceback (most recent call last):
  CRITICAL fatal: could not read Username for 'https://github.com': No such device or address
  
  CRITICAL ❌ ERROR! return code: 128
    File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
      exec(code, run_globals)
    File "/src/lineage/__main__.py", line 5, in <module>
      main()
    File "/src/lineage/entrypoint.py", line 431, in main
      fetch(repo, remote_url, remote_branch)
    File "/src/lineage/entrypoint.py", line 149, in fetch
      run([GIT, "fetch", remote_url, remote_branch], cwd=repo.full_name)
    File "/src/lineage/entrypoint.py", line 68, in run
      raise Exception("Subprocess was expected to exit with 0.")
  Exception: Subprocess was expected to exit with 0.
@mcdonnnj
Copy link
Member

mcdonnnj commented Dec 7, 2021

@Xerkus As I mentioned in your other issue would you try the improvement/use_github_api_for_all_access branch and see if things work as you expect?

@Xerkus
Copy link
Author

Xerkus commented Dec 7, 2021

Git client is missing auth when trying to clone the downstream repo. I assume same is true for cloning the private parent repo as well

  INFO Checking: Xerkus/private-lineage-test
  INFO Lineage configuration found for Xerkus/private-lineage-test
  INFO Cloning repository: https://github.com/Xerkus/private-lineage-test.git
  CRITICAL Cloning into 'Xerkus/private-lineage-test'...
  fatal: could not read Username for 'https://github.com': No such device or address
  
  CRITICAL ❌ ERROR! return code: 128
  ERROR Unable to clone Xerkus/private-lineage-test.
  Traceback (most recent call last):
    File "/src/lineage/entrypoint.py", line 406, in main
      run([GIT, "clone", repo.clone_url, repo.full_name])
    File "/src/lineage/entrypoint.py", line 69, in run
      raise Exception("Subprocess was expected to exit with 0.")
  Exception: Subprocess was expected to exit with 0.

Repo where action runs is not the same repo

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