Skip to content

Commit 82fd3d2

Browse files
authored
Merge pull request #325 from devicons/TB_bugFix
Fixed an async issue in the peek workflow and added a comment action
2 parents ed801c4 + ea3a0bf commit 82fd3d2

3 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/scripts/build_assets/SeleniumRunner.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ def set_options(self, download_path: str, geckodriver_path: str,
7575
self.driver = WebDriver(options=options, executable_path=geckodriver_path)
7676
self.driver.get(self.ICOMOON_URL)
7777
assert "IcoMoon App" in self.driver.title
78+
79+
# wait until the whole web page is loaded by testing the hamburger input
80+
hamburger_input = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
81+
ec.element_to_be_clickable((By.CSS_SELECTOR,
82+
"button.btn5.lh-def.transparent i.icon-menu"))
83+
)
84+
hamburger_input.click()
85+
print("Accessed icomoon.io")
7886

7987
def upload_icomoon(self, icomoon_json_path: str):
8088
"""
@@ -86,7 +94,7 @@ def upload_icomoon(self, icomoon_json_path: str):
8694
try:
8795
# find the file input and enter the file path
8896
import_btn = WebDriverWait(self.driver, SeleniumRunner.LONG_WAIT_IN_SEC).until(
89-
ec.presence_of_element_located((By.CSS_SELECTOR, "div#file input"))
97+
ec.element_to_be_clickable((By.CSS_SELECTOR, "div#file input"))
9098
)
9199
import_btn.send_keys(icomoon_json_path)
92100
except Exception as e:
@@ -138,6 +146,7 @@ def upload_svgs(self, svgs: List[str]):
138146
ec.element_to_be_clickable((By.XPATH, "//button[text()='Select All']"))
139147
)
140148
select_all_button.click()
149+
print("Finished uploading the svgs...")
141150
except Exception as e:
142151
self.close()
143152
raise e
@@ -155,7 +164,7 @@ def click_hamburger_input(self):
155164
)
156165

157166
menu_appear_callback = ec.element_to_be_clickable(
158-
(By.CSS_SELECTOR, "h1#setH2 ul")
167+
(By.CSS_SELECTOR, "h1 ul.menuList2")
159168
)
160169

161170
while not menu_appear_callback(self.driver):

.github/workflows/peek_icons.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,17 @@ jobs:
3737
if: ${{success()}}
3838
with:
3939
name: new_icons
40-
path: ./new_icons.png
40+
path: ./new_icons.png
41+
- name: Comment on the PR about the result
42+
uses: github-actions-up-and-running/pr-comment@v1.0.1
43+
with:
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
message: >
46+
Hi! I'm Devicons' GitHub Actions Bot!
47+
48+
I just peeked at the icons that you wanted to add and upload them to the
49+
[Actions page](https://github.com/devicons/devicon/actions). The maintainers
50+
will now take a look at it and decide whether to merge your PR.
51+
52+
Cheers :),
53+
Bot

devicon.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,7 @@
14691469
"plain"
14701470
],
14711471
"font": [
1472-
"line",
1473-
"plain"
1472+
"line"
14741473
]
14751474
},
14761475
"color": "#F0D6B7",

0 commit comments

Comments
 (0)