Skip to content

Commit e3fbace

Browse files
committed
fix the stuff with the spacing
Signed-off-by: Roger Barker <roger.barker@swirldslabs.com>
1 parent 78ff2df commit e3fbace

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

src/version2query.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
OUTPUT_FILE = f"output.items.json"
1313

1414
def get_github_token():
15-
"""Get GitHub token from environment variable."""
16-
token = os.getenv("GITHUB_TOKEN")
17-
if not token:
18-
raise ValueError("GITHUB_TOKEN environment variable is not set.")
19-
return token
15+
"""Get GitHub token from environment variable."""
16+
token = os.getenv("GITHUB_TOKEN")
17+
if not token:
18+
raise ValueError("GITHUB_TOKEN environment variable is not set.")
19+
return token
2020

2121
def get_github_orgs():
2222
"""Create a list of github orgs based on the authenticated user."""
@@ -35,41 +35,41 @@ def get_all_projects(orgs:list[str]) -> list[dict]:
3535
# Query projects for each org
3636
all_projects:list[dict] = []
3737
for org in orgs:
38-
print(f"[bold blue]Fetching projects for org: {org}[/bold blue]")
39-
40-
# the graphql query needed to pull in all the data from gh api
41-
query:str = """
42-
query($login: String!) {
43-
organization(login: $login) {
44-
projectsV2(first: 100) {
45-
nodes {
46-
id
47-
number
48-
title
49-
}
38+
print(f"[bold blue]Fetching projects for org: {org}[/bold blue]")
39+
40+
# the graphql query needed to pull in all the data from gh api
41+
query:str = """
42+
query($login: String!) {
43+
organization(login: $login) {
44+
projectsV2(first: 100) {
45+
nodes {
46+
id
47+
number
48+
title
5049
}
5150
}
5251
}
53-
"""
54-
55-
headers:dict = {"Authorization": f"Bearer {get_github_token()}"}
56-
response = requests.post(
57-
"https://api.github.com/graphql",
58-
json={"query": query, "variables": {"login": org}},
59-
headers=headers
60-
)
61-
62-
result = response.json()
63-
projects:list[dict] = [
64-
{
65-
"org": org,
66-
"number": project["number"],
67-
"title": project["title"]
68-
}
69-
for project in result.get("data", {}).get("organization", {}).get("projectsV2", {}).get("nodes", [])
70-
]
52+
}
53+
"""
54+
55+
headers:dict = {"Authorization": f"Bearer {get_github_token()}"}
56+
response = requests.post(
57+
"https://api.github.com/graphql",
58+
json={"query": query, "variables": {"login": org}},
59+
headers=headers
60+
)
61+
62+
result = response.json()
63+
projects:list[dict] = [
64+
{
65+
"org": org,
66+
"number": project["number"],
67+
"title": project["title"]
68+
}
69+
for project in result.get("data", {}).get("organization", {}).get("projectsV2", {}).get("nodes", [])
70+
]
7171

72-
all_projects.extend(projects)
72+
all_projects.extend(projects)
7373
return all_projects
7474

7575
def projects_filtered_by_team(project_list:list[dict], teams:list[str]) -> list[dict]:

0 commit comments

Comments
 (0)