Open Xerkus opened 2 years ago
@Xerkus Would you try the improvement/use_github_api_for_all_access branch and see if things work as you expect?
Lineage configuration is found, but it fails at cloning the repo.
Lineage configuration is found, but it fails at cloning the repo.
Ahh, sorry. I made a poor assumption about cloning behavior so I apologize. I have made a composition branch for testing because the two changes needed to resolve your issues belong in their own PRs. Would you try the testing/private_repo_access branch and let me know if things work as you expect this time?
Yes, this issue is resolved in the testing/private_repo_access
branch.
The error that I see now is #44 when trying to fetch the upstream:
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
INFO ✅ success
INFO Processing lineage: skeleton
INFO Upstream: https://github.com/Xerkus/private-lineage-test.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 455, in main
fetch(repo, remote_url, remote_branch)
File "/src/lineage/entrypoint.py", line 163, in fetch
run([GIT, "fetch", remote_url, remote_branch], cwd=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.
🐛 Summary
Private repositories can not be processed due to check for lineage configuration never returning result from unauthenticated request: https://github.com/cisagov/action-lineage/blob/3a0be21e6c85e835d46d11046ac05613ec2ff623/src/lineage/entrypoint.py#L110-L118
To reproduce
Steps to reproduce the behavior:
Expected behavior
Lineage action can get past the check for lineage configuration existence
Any helpful log output or screenshots