1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-30 17:50:35 +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:
Thomas Bui
2021-08-13 11:51:22 -07:00
committed by GitHub
parent e5aa8a9cad
commit 08aa325a84
17 changed files with 822 additions and 408 deletions

View File

@@ -2,10 +2,38 @@ import requests
import sys
import re
def get_merged_pull_reqs_since_last_release(token):
"""
Get all the merged pull requests since the last release.
"""
stopPattern = r"^(r|R)elease v"
pull_reqs = []
found_last_release = False
page = 1
print("Getting PRs since last release.")
while not found_last_release:
data = get_merged_pull_reqs(token, page)
# assume we don't encounter it during the loop
last_release_index = 101
for i in range(len(data)):
if re.search(stopPattern, data[i]["title"]):
found_last_release = True
last_release_index = i
break
pull_reqs.extend(data[:last_release_index])
page += 1
# should contain all the PRs since last release
return pull_reqs
def get_merged_pull_reqs(token, page):
"""
Get the merged pull requests based on page. There are
100 results page. See https://docs.github.com/en/rest/reference/pulls
100 results per page. See https://docs.github.com/en/rest/reference/pulls
for more details on the parameters.
:param token, a GitHub API token.
:param page, the page number.
@@ -71,30 +99,3 @@ def find_all_authors(pull_req_data, token):
authors.add(commit["commit"]["author"]["name"])
print(f"This URL didn't have an `author` attribute: {pull_req_data['commits_url']}")
return ", ".join(["@" + author for author in list(authors)])
def get_merged_pull_reqs_since_last_release(token):
"""
Get all the merged pull requests since the last release.
"""
stopPattern = r"^(r|R)elease v"
pull_reqs = []
found_last_release = False
page = 1
print("Getting PRs since last release.")
while not found_last_release:
data = get_merged_pull_reqs(token, page)
# assume we don't encounter it during the loop
last_release_index = 101
for i in range(len(data)):
if re.search(stopPattern, data[i]["title"]):
found_last_release = True
last_release_index = i
break
pull_reqs.extend(data[:last_release_index])
page += 1
# should contain all the PRs since last release
return pull_reqs