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
1
vote
1 answer

pygithub how to get latest commit on specific branch

Using pygithub how to get latest commit on specific branch in a repo equivalent to github rest api https://{github.com}/api/v3/repos/{repo/}/{org}/commits/{branch}?per_page=1 I followed the steps mentioned in pygithub - Receive all commits of a…
1
vote
1 answer

Why is this code throwing error after compiling

I made a script and it works perfectly but when I compile it with pyinstaller pyinstaller --onefile --icon='icon.ico' dmi.py It throws error, but if I don't compile it works I know Github module is throwing error. This is the code which throwing…
Ifan_Ifan
  • 43
  • 4
1
vote
1 answer

How to make the changes from one commit to another branch using PyGithub?

I have a repo where I have two branches: master and master_one. I have one commit (commit1) in master branch that is not present in master_one. Now I have created one more branch 'temp' from master_one. I wanted to merge the changes present in…
codeninja
  • 11
  • 3
1
vote
1 answer

Use OAuth with PyGithub to request private repo access

I am having trouble finding a way to request "repo" scope when authorizing a user in OAuth using the PyGithub library. My team is building a "repository analyzer" website that provides insights on code in a chosen repository. We are using the…
1
vote
1 answer

How can I get Helm's binary from their GitHub repo?

I'm trying to download Helm's latest release using a script. I want to download the binary and copy it to a file. I tried looking at the documentation, but it's very confusing to read and I don't understand this. I have found a way to download…
BloodLord
  • 49
  • 5
1
vote
1 answer

How can I download files from a Github repository without logging in?

I couldn't find anything online so that's why I'm posting it despite the question being simple. I'm writing a script that download an application's binary and puts it in a file. I would like the use the PyGitHub API to retrieve some information. The…
BloodLord
  • 49
  • 5
1
vote
0 answers

Create multiple files in GitHub and commit via a single commit without cloning repo locally

I was looking at the documentation for creating a file in GitHub using PyGitHub: https://pygithub.readthedocs.io/en/latest/github_objects/Repository.html However, it creates a commit for each file. In my use case, I will have several files to create…
iDev
  • 2,163
  • 10
  • 39
  • 64
1
vote
1 answer

Using PyGitHub to push file to GitHub with Python, getting a "Branch master not found" error

I am trying to upload a .csv file to GitHub using this code: ### THIS PART WOKRS ### g = Github("My_Access_Key") repo = g.get_user().get_repo('tradr') all_files = [] contents = repo.get_contents("") while contents: file_content =…
Benzle
  • 373
  • 3
  • 9
  • 18
1
vote
0 answers

Jenkins could not checkout in in an automatically created pull request

I created a script in Python which automatically creates PR and the repo has Jenkins pipeline enabled. Unfortunately Jenkins cannot handle PR created from script. Manually created PR is handled without troubles. I have tried changing PR name, branch…
Cierniostwor
  • 339
  • 2
  • 4
  • 15
1
vote
1 answer

Handle github.GithubException.GithubException: error

I have a function like this to create a github repo and return it. def CreateGitHubRepo(token, repo_name): # instantiate github account g = Github(token) # create authenticated user authed_user = g.get_user() # create a new…
hselbie
  • 1,749
  • 9
  • 24
  • 40
1
vote
0 answers

pygithub - how to create a check run?

I am trying to create a check run in github (reference: ) import jwt import time from github import Github pem_file = "ci-results.2020-11-27.private-key.pem" installation_id = 13221707 app_id = 90466 time_since_epoch_in_seconds =…
wantro
  • 373
  • 1
  • 7
  • 18
1
vote
1 answer

Push local git repository to a user's remote git repository using PyGithub and Python

Task is to Clone a public repository and store it locally Initialize a user's new repository(target) with the repository content that you downloaded locally. The CLI commands work perfectly but I need to do it using python, and when I run this…
KrisTej
  • 75
  • 4
1
vote
1 answer

Python PyGithub how to list projectCard?

I'm trying to access project card from github api with PyGithub but I'm unable to find how to call the projectcard method (https://developer.github.com/v3/projects/cards/) It seems to be ready to use…
JFMarquis
  • 127
  • 1
  • 1
  • 4
1
vote
1 answer

Creating a repository and commiting a file with PyGithub

I've seen the topic of commiting using PyGithub in many other questions here, but none of them helped me, I didn't understood the solutions, I guess I'm too newbie. I simply want to commit a file from my computer to a test github repository that I…
1
vote
2 answers

Python - pygithub If file exists then update else create

Im using PyGithub library to update files. Im facing an issue with that. Generally, we have to options. We can create a new file or if the file exists then we can update. Doc Ref:…
TheDataGuy
  • 2,712
  • 6
  • 37
  • 89