Skip to content

Commit 9fff7ac

Browse files
committed
add gitlab
1 parent 52fec90 commit 9fff7ac

31 files changed

+202
-126
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: "CodeQL"
22

33
on:
4-
push:
5-
paths:
6-
- "**.py"
74
schedule:
85
- cron: '0 4 * * 3'
96

@@ -32,21 +29,5 @@ jobs:
3229
# with:
3330
# languages: go, javascript, csharp, python, cpp, java
3431

35-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
36-
# If this step fails, then you should remove it and run the build manually (see below)
37-
- name: Autobuild
38-
uses: github/codeql-action/autobuild@v1
39-
40-
# ℹ️ Command-line programs to run using the OS shell.
41-
# 📚 https://git.io/JvXDl
42-
43-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
44-
# and modify them (or add more) to build your code if your project
45-
# uses a compiled language
46-
47-
#- run: |
48-
# make bootstrap
49-
# make release
50-
5132
- name: Perform CodeQL Analysis
5233
uses: github/codeql-action/analyze@v1

AddRepoMembers.py renamed to Github/AddRepoMembers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
mass add team members to repos, optionally creating new repos
45
@@ -9,9 +10,10 @@
910
oauth token must have "write:org" and public_repo (or repo for private) permissions
1011
https://developer.github.com/v3/repos/#oauth-scope-requirements
1112
"""
13+
1214
import pandas
1315
import github
14-
from pygithubutils import repo_exists, team_exists, check_api_limit, connect_github
16+
from gitbulk import repo_exists, team_exists, check_api_limit, connect_github
1517
from pathlib import Path
1618
from argparse import ArgumentParser
1719

@@ -44,8 +46,7 @@ def main():
4446
raise ValueError("need to have member names and team names. Check that -col argument matches spreadsheet.")
4547
# %%
4648
op, sess = connect_github(p.oauth, p.orgname)
47-
if not check_api_limit(sess):
48-
raise RuntimeError("GitHub API limit exceeded")
49+
check_api_limit(sess)
4950

5051
adder(teams, p.stem, p.private, p.create, op, sess)
5152

AddStaffToTeams.py renamed to Github/AddStaffToTeams.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
23
"""
34
Add staff (set of people) to teams matching pattern
45
@@ -10,7 +11,7 @@
1011

1112
import typing as T
1213
import github
13-
import pygithubutils as gb
14+
import gitbulk as gb
1415
from argparse import ArgumentParser
1516

1617

@@ -23,8 +24,7 @@ def main():
2324
p = p.parse_args()
2425

2526
op, sess = gb.connect_github(p.oauth, p.orgname)
26-
if not gb.check_api_limit(sess):
27-
raise RuntimeError("GitHub API limit exceeded")
27+
gb.check_api_limit(sess)
2828

2929
adder(op, sess, p.stem, p.staff)
3030

AddTeamMembers.py renamed to Github/AddTeamMembers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python3
2+
23
"""
34
mass add team members to Team, optionally creating new Teams
45
@@ -15,7 +16,7 @@
1516
import pandas
1617
import github
1718
import typing as T
18-
from pygithubutils import team_exists, check_api_limit, connect_github
19+
from gitbulk import team_exists, check_api_limit, connect_github
1920
from pathlib import Path
2021
from argparse import ArgumentParser
2122

@@ -47,8 +48,7 @@ def main():
4748
raise ValueError("need to have member names and team names. Check that -col argument matches spreadsheet.")
4849
# %%
4950
op, sess = connect_github(p.oauth, p.orgname)
50-
if not check_api_limit(sess):
51-
raise RuntimeError("GitHub API limit exceeded")
51+
check_api_limit(sess)
5252

5353
failed = adder(teams, p.stem, p.create, op, sess)
5454
if failed:

CopyFileByLanguage.py renamed to Github/CopyFileByLanguage.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
mass copy files by language.
45
Useful for templating CI by language e.g. .github/workflows/ci_python.yml etc.
@@ -10,12 +11,13 @@
1011
oauth token must have public_repo (or repo for private) permissions
1112
https://developer.github.com/v3/repos/#oauth-scope-requirements
1213
"""
14+
1315
from pathlib import Path
1416
from argparse import ArgumentParser
1517
import base64
1618

1719
import github
18-
import pygithubutils as gb
20+
import gitbulk as gb
1921

2022

2123
def main():
@@ -32,7 +34,7 @@ def main():
3234
copyfn = Path(P.copyfn).expanduser().resolve(True)
3335
copy_text = copyfn.read_text()
3436
target = P.targetfn
35-
sess = gb.github_session(P.oauth)
37+
sess = gb.session(P.oauth)
3638
gb.check_api_limit(sess)
3739
# %% get user / organization handle
3840
userorg = gb.user_or_org(sess, P.userorg)

CountGithubForks.py renamed to Github/CountGithubForks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
lists all repos for a Github user.
45
Can use Oauth login.
@@ -8,9 +9,10 @@
89
Maybe encrypted and with permissions 600.
910
The Oauth key should have no checkboxes, so that it's read only for public repos.
1011
"""
12+
1113
import pandas as pd
1214
from argparse import ArgumentParser
13-
import pygithubutils.repo_stats as gu
15+
import gitbulk.repo_stats as gu
1416

1517

1618
def main():

CountGithubStars.py renamed to Github/CountGithubStars.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
Totals up stars and fork count for all repos of a Github user.
45
Can use Oauth login if desired.
56
"""
7+
68
import pandas
79
from argparse import ArgumentParser
8-
import pygithubutils.repo_stats as gu
10+
import gitbulk.repo_stats as gu
911

1012

1113
def main():

CountStars.py renamed to Github/CountStars.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
Count how many GitHub Stars a user has received, using GitHub API v4 GraphQL
45
"""
6+
57
import requests
68
from pathlib import Path
79
import argparse

CreateGithubTeamRepos.py renamed to Github/CreateGithubTeamRepos.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
23
"""
34
mass create repos for teams
45
@@ -9,8 +10,9 @@
910
oauth token must have "admin:org" and public_repo (or repo for private) permissions
1011
https://developer.github.com/v3/repos/#oauth-scope-requirements
1112
"""
13+
1214
import pandas
13-
from pygithubutils import connect_github, repo_exists, check_api_limit
15+
from gitbulk import connect_github, repo_exists, check_api_limit
1416
from pathlib import Path
1517
from argparse import ArgumentParser
1618

@@ -33,8 +35,7 @@ def main():
3335
teams = pandas.read_excel(fn, usecols=",".join(p.col)).squeeze().dropna().drop_duplicates()
3436
# %%
3537
op, sess = connect_github(p.oauth, p.orgname)
36-
if not check_api_limit(sess):
37-
raise RuntimeError("GitHub API limit exceeded")
38+
check_api_limit(sess)
3839

3940
if teams.ndim == 1:
4041
by_num(teams, p.stem, p.private, op, sess)

DuplicateGithubRepos.py renamed to Github/DuplicateGithubRepos.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
Assumes you have an SSH key loaded for git push --mirror step
1111
"""
1212
from argparse import ArgumentParser
13-
import pygithubutils.duplicator as gu
14-
import pygithubutils as gb
13+
import gitbulk.duplicator as gu
14+
import gitbulk as gb
1515

1616

1717
def main():

0 commit comments

Comments
 (0)