mirror of
https://github.com/konpa/devicon.git
synced 2025-08-22 22:24:43 +02:00
Feature: Peek and Build-Bot Upgrade (#806)
* Refactored peek script into a class * Post-peek workflow now upload the new screenshots * Refactored BuildSeleniumRunner into a class * Updated build_icons.yml to reflect new changes * Fixed issue with building icons that were already in the app * Build script will take screenshot of new icons * Update post peek yaml message * Added alerts * Peek script now check for strokes in icons * Updated post_peek's strokes in svgs message * Updated post_peek script's message * Updated post_peek's message * Refactored get_release_message into icomoon_build * Change devicon.css name to devicon-base.css * Updated post_peek message * Added update icon as a valid PR title for bot-peek * Add \n char to SVG after it gets optimized * Fixed error with 'update icon' regex * Build script now batch issues when upload SVG * Addressed build-bot's screenshot order * Apply suggestions from code review Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
14
.github/scripts/build_assets/util.py
vendored
14
.github/scripts/build_assets/util.py
vendored
@@ -56,9 +56,13 @@ def find_object_added_in_pr(icons: List[dict], pr_title: str):
|
||||
:raise If no object can be found, raise an Exception.
|
||||
"""
|
||||
try:
|
||||
pattern = re.compile(r"(?<=^new icon: )\w+ (?=\(.+\))", re.I)
|
||||
icon_name = pattern.findall(pr_title)[0].lower().strip() # should only have one match
|
||||
icon = [icon for icon in icons if icon["name"] == icon_name][0]
|
||||
pattern = re.compile(r"(?<=^new icon: )\w+ (?=\(.+\))|(?<=^update icon: )\w+ (?=\(.+\))", re.I)
|
||||
icon_name_index = 0
|
||||
icon_name = pattern.findall(pr_title)[icon_name_index].lower().strip() # should only have one match
|
||||
icon = [icon for icon in icons if icon["name"] == icon_name][0]
|
||||
return icon
|
||||
except IndexError: # there are no match in the findall()
|
||||
raise Exception("Couldn't find an icon matching the name in the PR title.")
|
||||
except IndexError as e: # there are no match in the findall()
|
||||
print(e)
|
||||
message = "util.find_object_added_in_pr: Couldn't find an icon matching the name in the PR title.\n" \
|
||||
f"PR title is: '{pr_title}'"
|
||||
raise Exception(message)
|
||||
|
Reference in New Issue
Block a user