Python Forum
How to check whether a file exist in all github branch using github3.py
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check whether a file exist in all github branch using github3.py
#1
I want to get all the branches in which a file name called listofusers.py is available

import os
import github3
def get_all_branches_from_github():
 gh = github3.enterprise_login(
            url='xxxxxxxxxxxxx',
            token=os.environ["GITHUB_TOKEN"],
         )
    org = gh.organization("ABCDE") // Branches under the "ABCDE"
        for repo in org.repositories():
            name = repo.name
	

if __name__ == "__main__":
    names = get_all_branches_from_github()
Thank you
Larz60+ write Nov-03-2020, 09:45 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Fixed for you this time, please use bbcode tags going forward. Thank you.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020