Skip to content

Commit 8bc3da3

Browse files
authored
fix check svg icons workflow (#508)
2 parents b627c57 + d249515 commit 8bc3da3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

.github/scripts/build_assets/filehandler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,20 @@ def get_added_modified_svgs(files_added_json_path: str,
213213
Get the svgs added and modified from the files_changed_json_path.
214214
:param: files_added_json_path, the path to the files_added.json created by the gh-action-get-changed-files@2.1.4
215215
:param: files_modified_json_path, the path to the files_modified.json created by the gh-action-get-changed-files@2.1.4
216-
:return: a list of the svg file paths that were added/modified in this pr as Path.
216+
:return: a list of the svg file paths that were added/modified in this pr as Path. It will only return icons in /icons path (see https://github.com/devicons/devicon/issues/505)
217217
"""
218218
files_added = get_json_file_content(files_added_json_path)
219219
files_modified = get_json_file_content(files_modified_json_path)
220220

221221
svgs = []
222222
for file in files_added:
223223
path = Path(file)
224-
if path.suffix.lower() == ".svg":
224+
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
225225
svgs.append(path)
226226

227227
for file in files_modified:
228228
path = Path(file)
229-
if path.suffix.lower() == ".svg":
229+
if path.suffix.lower() == ".svg" and path.as_posix().lower().startswith('icons/'):
230230
svgs.append(path)
231231

232232
return svgs

0 commit comments

Comments
 (0)