Questions tagged [pygithub]

PyGitHub is a Python library implementing the GitHub REST API v3, to manage GitHub resources (repositories, user profiles, organizations, etc.) from Python scripts.

PyGitHub is a Python library implementing the GitHub API v3, to manage GitHub resources (repositories, user profiles, organizations, etc.) from Python scripts.

See also

210 questions
2
votes
0 answers

Upload large file (>100 MB) directly to github with pygithub

I am using pyGitHub to upload files to my repo, however some of the files are so large that the server connection times out. My code to upload/overwrite a file from a folder is: def commit(folder): foldername = folder.split("/")[-1] …
Yetiowner
  • 123
  • 8
2
votes
2 answers

update_team_repository(repo, permission) not updating the repo permissions in GitHub

I am using the below snippet to add the repos to an existing team "ADMIN" and then to change the permissions of all the repos to 'Admin'. from github import **Github** def teams_permissions(pat): print("") admin = 'ADMIN' for teams in…
raiv
  • 21
  • 1
2
votes
1 answer

github.GithubException.UnknownObjectException: 404 {"message": "Not Found",

Full error: File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/github/Repository.py", line 2154, in update_file headers, data = self._requester.requestJsonAndCheck( File…
Sukanta
  • 75
  • 6
2
votes
1 answer

PyGithub - Cant import Github from github

I am working on a project that needs to interface with github and clone the repo as a way to update itself. I am just beginning to play around with PyGithub (seems very easy to use) but I keep getting this error: Traceback (most recent call last): …
Pulldown
  • 65
  • 1
  • 6
2
votes
0 answers

Setting Accept Headers in PyGithub API for getting commit diff

I want to get the result of the below query using PyGithub. Is there a way to set accept header in pygithub? I want the output in diff format and I don't want to use github compare API. So is there a way to make below request using pygithub? curl \ …
2
votes
1 answer

How to debug PyGitHub not being responsive?

I'm using PyGitHub to update my GitHub.com repos from inside a Ubuntu server using a python script. I have noticed there are times, when my script just hangs there and there's no error message indicating what went wrong. This is my script from…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
2
votes
0 answers

Python Github update file throws UnknownObjectException (404)

I am trying to update the contents of a file on github with the following code file = repo.get_contents('test.csv', ref="main") data = file.decoded_content.decode("utf-8") data += "\n test;test;test" repo.update_file(file.path, "automatic update",…
Fildc
  • 33
  • 2
2
votes
2 answers

How to get contents of file in pull request from pygithub?

I'm not able to find how to get contents of file present in pull request on github. Is there any way to do this using pygithub? For repository, we can do this using contents = repo.get_contents(filename) However, I did not find such api for pull…
Ruchit Vithani
  • 331
  • 4
  • 12
2
votes
1 answer

account name in PyGithub

I am using the package PyGithub in order to try and automate the creation of a new github repo. from github import Github g = Github(token) user = g.get_user() repo = user.create_repo(name) After creating that repo I am creating a local one too,…
Eliran Turgeman
  • 1,526
  • 2
  • 16
  • 34
2
votes
1 answer

how to get github pull request all reviewers using python (pyGithub)

I'm using pyGithub to interact with github, i'd like to get all reviewer list for a pull request. There's a api pullrequest.get_review_requests() which only returns people who were asked for review, not returning people who joined as reviewer. Is…
Neo Gónzáles
  • 191
  • 2
  • 13
2
votes
2 answers

pygithub create pull request GithubException "not all refs are readable"

I am using Pygithub to trying to create a pull request. # push branch cmd = ["git", "push", "origin", "HEAD:refs/heads/my-branch"] subprocess.run(cmd, check=True) ... # then create PR repo =…
OLIVER.KOO
  • 5,654
  • 3
  • 30
  • 62
2
votes
1 answer

List workflow runs of develop branch in Github using PyGithub

I would like to list all Workflow Runs in a Repo for only Develop branch. I am using the below script. It lists workflows in all the branches under a repo. Could you please help modifying it to list only the specific Branch?? for org_repo in REPOS: …
2
votes
0 answers

GitCommandError: Cmd('git') failed due to: exit code(1), pygithub

I am trying to automate the process of cloning, adding a few files to the local clone, and then pushing the update to the cloned repo. I expected this code to push my commit to the cloned repo in GitHub, but When I try pushing I keep getting this…
ScottyBlades
  • 12,189
  • 5
  • 77
  • 85
2
votes
0 answers

pygithub - Receive all commits of a specific branch

I am using pygithub for analyzing repositories and iterating on all commits of a repository. But how can I extract the corresponding branch for each commit? commits = repo.get_commits() for commit in commits: # print(commit.branch) ...…
2
votes
0 answers

Get a count of github issues within a date range

I'm trying to get a count of issues using PyGithub in a repository within a certain date range (the month). The date range is what I can't get right no matter what I've tried. Using the GitHub webui, this is the query I would use: is:issue…
DBS
  • 1,107
  • 1
  • 12
  • 24
1 2
3
13 14