Skip to content

Commit ed6fe69

Browse files
authored
fix: allow github token auth (#6)
1 parent 63f7d60 commit ed6fe69

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ jobs:
2424
git add .
2525
git commit -m "feat: update source data and csvs"
2626
git push -u origin
27-
gh pr create --fill
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Create PR
30+
run: gh pr create --fill
31+
env:
32+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

scripts/fetch_data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23

34
from github import Auth, Github
@@ -110,7 +111,11 @@
110111

111112

112113
def main() -> None:
113-
github = Github(auth=Auth.NetrcAuth())
114+
if github_token := os.environ.get("GITHUB_TOKEN"):
115+
auth = Auth.Token(github_token)
116+
else:
117+
auth = Auth.NetrcAuth()
118+
github = Github(auth=auth)
114119

115120
# Fetch repo data
116121
for repository in REPOSITORIES:

0 commit comments

Comments
 (0)