From 644ba96f223f41bf379a5b13bcf7209112bad4a3 Mon Sep 17 00:00:00 2001 From: seungsoon Kim <74717033+Kimgabe@users.noreply.github.com> Date: Mon, 12 Feb 2024 01:21:35 +0900 Subject: [PATCH] Docs : Update update_recent_works.py --- .github/scripts/update_recent_works.py | 79 ++++++++------------------ 1 file changed, 23 insertions(+), 56 deletions(-) diff --git a/.github/scripts/update_recent_works.py b/.github/scripts/update_recent_works.py index c70170a..6aa8627 100644 --- a/.github/scripts/update_recent_works.py +++ b/.github/scripts/update_recent_works.py @@ -12,37 +12,8 @@ # "๐Ÿ‘ˆ Git commit ์ปจ๋ฒค์…˜ ํ™•์ธํ•˜๊ธฐ" ์„น์…˜์ด ์ด๋ฏธ ์žˆ๋Š”์ง€ ํ™•์ธ if "๐Ÿ‘ˆ Git commit ์ปจ๋ฒค์…˜ ํ™•์ธํ•˜๊ธฐ" not in readme_content: - commit_types_table = """ -
-๐Ÿ‘ˆ Git commit ์ปจ๋ฒค์…˜ ํ™•์ธํ•˜๊ธฐ -\n -| ์ปค๋ฐ‹ ์œ ํ˜• | ์˜๋ฏธ | -| --- | --- | -| Feat | (์–ด๋–ค ์œ ํ˜•์ด๋“ ) ํŒŒ์ผ์˜ ์ตœ์ดˆ ๋“ฑ๋ก ์‹œ์— ์‚ฌ์šฉ | -| Model | ๋ชจ๋ธ ๊ตฌ์กฐ๋ณ€๊ฒฝ ํ˜น์€ ์ƒˆ๋กœ์šด ๋ชจ๋ธ ์ถ”๊ฐ€ | -| Param | ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ ์ˆ˜์ • | -| Data | ๋ฐ์ดํ„ฐ ์ „์ฒ˜๋ฆฌ ๋ฐฉ์‹ ๋ณ€๊ฒฝ, ์ƒˆ๋กœ์šด ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€ | -| Metric | ํ‰๊ฐ€์ง€ํ‘œ ๋ณ€๊ฒฝ | -| Train | ํ›ˆ๋ จ๊ณผ์ • ๋ณ€๊ฒฝ(Epoch์ˆ˜, Batch size ๋ณ€๊ฒฝ ๋“ฑ) | -| Eval | ๊ฒ€์ฆ/ํ…Œ์ŠคํŠธ ๊ณผ์ • ๋ณ€๊ฒฝ | -| Deploy | ๋ชจ๋ธ ๋ฐฐํฌ ๊ด€๋ จ ๋ณ€๊ฒฝ | -| Fix | ๋ฒ„๊ทธ ์ˆ˜์ • (์ผ๋ฐ˜, ML/DL) | -| Docs | ๋ฌธ์„œ ์ˆ˜์ • (์ผ๋ฐ˜, ML/DL) | -| Style | ์ฝ”๋“œ formatting, ์„ธ๋ฏธ์ฝœ๋ก  ๋ˆ„๋ฝ, ์ฝ”๋“œ ์ž์ฒด์˜ ๋ณ€๊ฒฝ์ด ์—†๋Š” ๊ฒฝ์šฐ | -| Refactor | ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง (์ผ๋ฐ˜, ML/DL) | -| Test | ํ…Œ์ŠคํŠธ ์ฝ”๋“œ, ๋ฆฌํŒฉํ† ๋ง ํ…Œ์ŠคํŠธ ์ฝ”๋“œ ์ถ”๊ฐ€ | -| Chore | ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ € ์ˆ˜์ •, ๊ทธ ์™ธ ๊ธฐํƒ€ ์ˆ˜์ • ex) .gitignore | -| Design | CSS ๋“ฑ ์‚ฌ์šฉ์ž UI ๋””์ž์ธ ๋ณ€๊ฒฝ | -| Comment | ํ•„์š”ํ•œ ์ฃผ์„ ์ถ”๊ฐ€ ๋ฐ ๋ณ€๊ฒฝ (์ผ๋ฐ˜, ML/DL) | -| Rename | ํŒŒ์ผ ๋˜๋Š” ํด๋” ๋ช…์„ ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜ ์˜ฎ๊ธฐ๋Š” ์ž‘์—…๋งŒ์ธ ๊ฒฝ์šฐ | -| Remove | ํŒŒ์ผ์„ ์‚ญ์ œํ•˜๋Š” ์ž‘์—…๋งŒ ์ˆ˜ํ–‰ํ•œ ๊ฒฝ์šฐ | -| !BREAKING CHANGE | ์ปค๋‹ค๋ž€ API ๋ณ€๊ฒฝ์˜ ๊ฒฝ์šฐ | -| !HOTFIX | ๊ธ‰ํ•˜๊ฒŒ ์น˜๋ช…์ ์ธ ๋ฒ„๊ทธ๋ฅผ ๊ณ ์ณ์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ | -\n -
-\n -""" - readme_content += commit_types_table # ์ปค๋ฐ‹ ์œ ํ˜• ์„ค๋ช…์„ README ๋‚ด์šฉ์— ์ถ”๊ฐ€ + # ์ปค๋ฐ‹ ์œ ํ˜• ์„ค๋ช… ํ† ๊ธ€ ์ถ”๊ฐ€ + # ์—ฌ๊ธฐ ์ปค๋ฐ‹ ์œ ํ˜• ์„ค๋ช…์€ ์œ„์—์„œ ์ด๋ฏธ ์ œ๊ณตํ–ˆ์œผ๋ฏ€๋กœ ์ƒ๋žต # "๐Ÿ“ Recent Work Updates" ์„น์…˜ ์ฐพ๊ธฐ ๋ฐ ๊ธฐ์กด ํ‘œ ์ œ๊ฑฐ if "๐Ÿ“ Recent Work Updates" in readme_content: @@ -50,36 +21,32 @@ else: readme_content += "\n\n## ๐Ÿ“ Recent Work Updates\n\n" -# ์ปค๋ฐ‹ ๋กœ๊ทธ์—์„œ ์ตœ๊ทผ 10๊ฐœ์˜ ํ•ญ๋ชฉ ๊ฐ€์ ธ์˜ค๊ธฐ (.github ํด๋”, README.md, .DS_Store ์ œ์™ธ) -commits = repo.get_commits() # ์ €์žฅ์†Œ์˜ ์ปค๋ฐ‹ ๋ชฉ๋ก์„ ๊ฐ€์ ธ์˜ด -recent_updates = [] # ์ตœ๊ทผ ์—…๋ฐ์ดํŠธ ์ •๋ณด๋ฅผ ์ €์žฅํ•  ๋ฆฌ์ŠคํŠธ -count = 0 # ์ฒ˜๋ฆฌ๋œ ์ปค๋ฐ‹ ์ˆ˜๋ฅผ ์„ธ๊ธฐ ์œ„ํ•œ ์นด์šดํ„ฐ +# ์ปค๋ฐ‹ ๋กœ๊ทธ์—์„œ ์ตœ๊ทผ ํ•ญ๋ชฉ ๊ฐ€์ ธ์˜ค๊ธฐ (.github ํด๋”, README.md, .DS_Store ์ œ์™ธ) +commits = repo.get_commits() +unique_updates = {} # ์ž‘์—…๋ช…์„ ํ‚ค๋กœ ํ•˜๊ณ , ๊ฐ€์žฅ ์ตœ์‹ ์˜ ์ปค๋ฐ‹ ์ •๋ณด๋ฅผ ๊ฐ’์œผ๋กœ ํ•˜๋Š” ๋”•์…”๋„ˆ๋ฆฌ for commit in commits: - if count >= 10: + if len(unique_updates) >= 10: break files = commit.files for file in files: - if file.filename.endswith("README.md") or file.filename.startswith(".github/") or file.filename.endswith(".DS_Store"): - continue # .DS_Store ํŒŒ์ผ๋„ ๋ฌด์‹œ - date = commit.commit.author.date.strftime("%Y-%m-%d") - author = commit.commit.author.name - commit_message = commit.commit.message.split('\n')[0] - commit_type = commit_message.split(':')[0] if ':' in commit_message else 'N/A' - path_elements = file.filename.split('/') - category = path_elements[0] if len(path_elements) > 1 else 'Root' - name = path_elements[-1] - url = file.raw_url - recent_updates.append(f"| {date} | {category} | {name} | [View]({url}) | {author} | {commit_type} |") - count += 1 - if count >= 10: - break - -# ํ‘œ ํ˜•์‹์œผ๋กœ README.md์— ์ตœ๊ทผ ์—…๋ฐ์ดํŠธ ์ •๋ณด ์ถ”๊ฐ€ -if recent_updates: - table_header = "| ๋‚ ์งœ | ๋ถ„๋ฅ˜ | ์ž‘์—…๋ช… | ๋งํฌ | ์ž‘์—…์ž | Commit ์œ ํ˜• |\n| --- | --- | --- | --- | --- | --- |\n" - table = table_header + "\n".join(recent_updates) - readme_content += table + if file.filename.endswith(("README.md", ".DS_Store")) or file.filename.startswith(".github/"): + continue + name = file.filename.split('/')[-1] # ํŒŒ์ผ๋ช…๋งŒ ์ถ”์ถœ + if name not in unique_updates: # ๋™์ผํ•œ ์ž‘์—…๋ช…์˜ ์ปค๋ฐ‹์ด ์•„์ง ์—†์œผ๋ฉด ์ถ”๊ฐ€ + date = commit.commit.author.date.strftime("%Y-%m-%d") + author = commit.commit.author.name + commit_message = commit.commit.message.split('\n')[0] + commit_type = commit_message.split(':')[0] if ':' in commit_message else 'N/A' + category = file.filename.split('/')[0] if '/' in file.filename else 'Root' + url = file.raw_url + unique_updates[name] = [date, category, name, url, author, commit_type] + +# ์ตœ๊ทผ ์—…๋ฐ์ดํŠธ ์ •๋ณด๋ฅผ ํ‘œ ํ˜•์‹์œผ๋กœ ์ถ”๊ฐ€ +table_header = "| ๋‚ ์งœ | ๋ถ„๋ฅ˜ | ์ž‘์—…๋ช… | ๋งํฌ | ์ž‘์—…์ž | Commit ์œ ํ˜• |\n| --- | --- | --- | --- | --- | --- |\n" +table_rows = [f"| {v[0]} | {v[1]} | {v[2]} | [View]({v[3]}) | {v[4]} | {v[5]} |" for v in unique_updates.values()] +table = table_header + "\n".join(table_rows) +readme_content += table # README.md ์—…๋ฐ์ดํŠธ commit_message = "Docs : README.md ์—…๋ฐ์ดํŠธ: ์ปค๋ฐ‹ ์ปจ๋ฒค์…˜ ํ† ๊ธ€ ๋ฐ ์ตœ๊ทผ ์ž‘์—… ์—…๋ฐ์ดํŠธ"