Skip to content

Commit 4e1683c

Browse files
authored
Update update_readme.py
1 parent a77affb commit 4e1683c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

โ€Župdate_readme.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ def get_kst_time(commit_time):
1313
kst_time = utc_time.replace(tzinfo=pytz.utc).astimezone(KST)
1414
return kst_time.strftime('%Y-%m-%d %H:%M')
1515

16+
# ๋ ˆํฌ์ง€ํ† ๋ฆฌ๊ฐ€ public์ธ์ง€ ํ™•์ธํ•˜๋Š” ํ•จ์ˆ˜
17+
def is_public_repo(user_repo):
18+
url = f"https://api.github.com/repos/{user_repo}"
19+
response = requests.get(url)
20+
if response.status_code == 200:
21+
return response.json().get('private', False) == False
22+
return False
23+
1624
# GitHub API ์‘๋‹ต์—์„œ ํŒŒ์ผ ๋ชฉ๋ก์„ ์ฒ˜๋ฆฌํ•˜๋Š” ์ฝ”๋“œ
1725
def get_data(user_repo):
18-
token = os.getenv('GITHUB_TOKEN') # GITHUB_TOKEN ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ํ† ํฐ์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
26+
token = os.getenv('GITHUB_TOKEN') # GITHUB_TOKEN ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ํ† ํฐ ๊ฐ€์ ธ์˜ค๊ธฐ
1927
headers = {}
2028

2129
# private ๋ ˆํฌ์ผ ๋•Œ๋งŒ Authorization ํ—ค๋” ์ถ”๊ฐ€

0 commit comments

Comments
ย (0)