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

git.exc.InvalidGitRepositoryError with wrong repo directory #81

Closed
Singwai opened this issue Dec 4, 2019 · 1 comment
Closed

git.exc.InvalidGitRepositoryError with wrong repo directory #81

Singwai opened this issue Dec 4, 2019 · 1 comment
Labels
waiting for feedback Waiting for feedback

Comments

@Singwai
Copy link

Singwai commented Dec 4, 2019

 Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1
  Downloading https://files.pythonhosted.org/packages/b4/40/a9837291310ee1ccc242ceb6ebfd9eb21539649f193a7c8c86ba15b98539/urllib3-1.25.7-py2.py3-none-any.whl (125kB)
Collecting chardet<3.1.0,>=3.0.2
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
Collecting idna<2.9,>=2.5
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
Installing collected packages: smmap2, gitdb2, GitPython, wrapt, deprecated, pyjwt, certifi, urllib3, chardet, idna, requests, six, PyGithub
    Running setup.py install for wrapt: started
    Running setup.py install for wrapt: finished with status 'done'
    Running setup.py install for PyGithub: started
    Running setup.py install for PyGithub: finished with status 'done'
Successfully installed GitPython-3.0.5 PyGithub-1.44.1 certifi-2019.11.28 chardet-3.0.4 deprecated-1.2.7 gitdb2-2.0.6 idna-2.8 pyjwt-1.7.1 requests-2.22.0 six-1.13.0 smmap2-2.0.5 urllib3-1.25.7 wrapt-1.11.2
python /home/runner/work/_actions/peter-evans/create-pull-request/v1/dist/src/create-pull-request.py
Traceback (most recent call last):
  File "/home/runner/work/_actions/peter-evans/create-pull-request/v1/dist/src/create-pull-request.py", line 233, in <module>
    repo = Repo(os.getcwd())
  File "/opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/git/repo/base.py", line 184, in __init__
    raise InvalidGitRepositoryError(epath)
git.exc.InvalidGitRepositoryError: /home/runner/work/react-ui/react-ui

I got the above error when trying to trigger the action.

I think this is related to this issue.

gitpython-developers/GitPython#255

Which can be fixed by changing this line.
https://github.com/peter-evans/create-pull-request/blob/master/src/create-pull-request.py#L233

@peter-evans
Copy link
Owner

@Singwai Thank you for reporting this issue and finding a fix.

I'm interested to know how to reproduce this error so I can test the fix. What does your workflow look like? Somehow you are executing the action in a directory that isn't the root of the repository and doesn't contain a .git directory?

@peter-evans peter-evans added the waiting for feedback Waiting for feedback label Dec 5, 2019
@Singwai Singwai closed this as completed Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Waiting for feedback
Projects
None yet
Development

No branches or pull requests

2 participants