1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-11 09:04:27 +02:00

Various bug fixes and added ability to comment multiple files

This commit is contained in:
Thomas Bui
2020-12-29 21:49:39 -08:00
parent c388503d28
commit a9eb51aca5
11 changed files with 21 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
from argparse import ArgumentParser
from build_assets.PathResolverAction import PathResolverAction
def get_selenium_runner_args(peek_mode=False):
parser = ArgumentParser(description="Upload svgs to Icomoon to create icon files.")
@@ -32,13 +33,4 @@ def get_selenium_runner_args(peek_mode=False):
parser.add_argument("--pr_title",
help="The title of the PR that we are peeking at")
return parser.parse_args()
def get_generate_markdown_args():
parser = ArgumentParser(description="Generate markdown for the image urls passed in.")
parser.add_argument("img_urls",
help="The urls of the images. Must be the string/JSON form of an array. Ex: '[1,2,3]'")
return parser.parse_args()

View File

@@ -1,19 +1,10 @@
from typing import List
from build_assets import arg_getters
def generate_screenshot_markdown(img_urls: List[str]):
"""
Generate the markdown for the screenshots using the
img_urls then print it to the console.
:param img_urls are valid image links.
"""
template = "![Detailed Screenshot]({})"
return [template.format(img_url) for img_url in img_urls]
import json
import os
if __name__ == "__main__":
args = arg_getters.get_generate_markdown_args()
markdown = generate_screenshot_markdown(args.img_urls)
print("\n\n".join(markdown)) # format it before printing
img_urls_list = json.loads(os.environ["IMG_URLS"])
template = "![Detailed Screenshot]({})"
markdown = [template.format(img_url) for img_url in img_urls_list]
print("\n\n".join(markdown))

View File

@@ -34,7 +34,7 @@ jobs:
run: npm run build-css
- name: Upload screenshot of the newly made icons
id: imgur_step
uses: devicons/public-upload-to-imgur@v1.1.2
uses: devicons/public-upload-to-imgur@v2
if: success()
with:
path: ./new_icons.png

View File

@@ -35,31 +35,32 @@ jobs:
name: geckodriver-log
path: ./geckodriver.log
- name: Upload screenshot of the newly made icons
id: new_icons_overview_step
uses: devicons/public-upload-to-imgur@main
id: icons_overview_img_step
uses: devicons/public-upload-to-imgur@v2
if: success()
with:
path: ./screenshots/new_icons.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload zoomed in screenshot of the newly made icons
id: new_icons_detailed_step
uses: devicons/public-upload-to-imgur@main
id: icons_detailed_img_step
uses: devicons/public-upload-to-imgur@v2
if: success()
with:
path: ./screenshots/screenshot_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Generate the markdowns for the screenshot and put it in the DETAILED_IMGS_MARKDOWN env var
if: success()
env:
IMG_URLS: ${{ steps.new_icons_detailed_step.outputs.img_url }}
IMG_URLS: ${{ steps.icons_detailed_img_step.outputs.imgur_urls }}
run: |
echo "DETAILED_IMGS_MARKDOWN<<EOF" >> $GITHUB_ENV
python ./.github/scripts/generate_screenshot_markdown.py "%IMG_URLS%" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
shell: cmd
echo 'DETAILED_IMGS_MARKDOWN<<EOF' >> $GITHUB_ENV
python ./.github/scripts/generate_screenshot_markdown.py >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
shell: bash
- name: Comment on the PR about the result
uses: github-actions-up-and-running/pr-comment@v1.0.1
env:
OVERVIEW_IMG_URL: ${{ steps.imgur_step.outputs.imgur_url }}
OVERVIEW_IMG_URL: ${{ fromJSON(steps.icons_overview_img_step.outputs.imgur_urls)[0] }}
MESSAGE: |
Hi!
@@ -80,4 +81,4 @@ jobs:
Peek Bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: ${{format(env.MESSAGE, env.IMG_URL, env.DETAILED_IMGS_MARKDOWN)}}
message: ${{format(env.MESSAGE, env.OVERVIEW_IMG_URL, env.DETAILED_IMGS_MARKDOWN)}}

View File

@@ -2173,40 +2173,6 @@
"color": "#a62c46",
"aliases": []
},
{
"name": "testingicon",
"tags": [
"framework"
],
"versions": {
"svg": [
"original",
"plain"
],
"font": [
"plain"
]
},
"color": "#61dafb",
"aliases": [ ]
},
{
"name": "testingicon2",
"tags": [
"framework"
],
"versions": {
"svg": [
"original",
"plain"
],
"font": [
"plain"
]
},
"color": "#61dafb",
"aliases": [ ]
},
{
"name": "react",
"tags": [

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><style type="text/css">.st0{fill:#1F0740;}.st1{fill:#D490C5;}</style><rect x="6.5" y="6.5" class="st0" width="115" height="115"/><path class="st1" d="M0,0v128h128V0H0z M121.5,121.5H6.5V6.5h115V121.5z"/><path class="st1" d="M103.5,59.2c0,0-0.6-14.6-16.5-14.6c-16,0-17.3,22-17.3,22v4.7c0,0,2.8,18.3,16.3,18.3 c13.5,0,14.8-2.6,14.8-2.6v-8.1c0,0-19.3,9.2-21.2-10h24V59.2z M94.5,61.6H79.5c0,0,0-8.3,7.5-9.2C95.2,52.4,94.5,61.6,94.5,61.6z "/><path class="st1" d="M50.5,29.9H38.4v3.8l-16,54.9h9.4l4.4-16.1H53l4.5,16.1h10.3L50.5,29.9z M38.2,63.1l6.4-24.5L51,63.1H38.2z"/></svg>

Before

Width:  |  Height:  |  Size: 637 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><style type="text/css">.st0{fill:#1F0740;}</style><path class="st0" d="M87,52.4c-7.5,0.9-7.5,9.2-7.5,9.2h14.9C94.5,61.6,95.2,52.4,87,52.4z"/><path class="st0" d="M 38.2,63.1 51,63.1 44.6,38.7 z"/><path class="st0" d="M0,0v128h128V0H0z M57.5,88.6L53,72.5H36.2l-4.4,16.1h-9.4l16-54.9v-3.8h12.2l17.3,58.7H57.5z M103.5,69h-24 c1.9,19.2,21.2,10,21.2,10V87c0,0-1.3,2.6-14.8,2.6c-13.5,0-16.3-18.3-16.3-18.3v-4.7c0,0,1.3-22,17.3-22 c16,0,16.5,14.6,16.5,14.6V69z"/></svg>

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><style type="text/css">.st0{fill:#1F0740;}.st1{fill:#D490C5;}</style><rect x="6.5" y="6.5" class="st0" width="115" height="115"/><path class="st1" d="M0,0v128h128V0H0z M121.5,121.5H6.5V6.5h115V121.5z"/><path class="st1" d="M103.5,59.2c0,0-0.6-14.6-16.5-14.6c-16,0-17.3,22-17.3,22v4.7c0,0,2.8,18.3,16.3,18.3 c13.5,0,14.8-2.6,14.8-2.6v-8.1c0,0-19.3,9.2-21.2-10h24V59.2z M94.5,61.6H79.5c0,0,0-8.3,7.5-9.2C95.2,52.4,94.5,61.6,94.5,61.6z "/><path class="st1" d="M50.5,29.9H38.4v3.8l-16,54.9h9.4l4.4-16.1H53l4.5,16.1h10.3L50.5,29.9z M38.2,63.1l6.4-24.5L51,63.1H38.2z"/></svg>

Before

Width:  |  Height:  |  Size: 637 B

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><style type="text/css">.st0{fill:#1F0740;}</style><path class="st0" d="M87,52.4c-7.5,0.9-7.5,9.2-7.5,9.2h14.9C94.5,61.6,95.2,52.4,87,52.4z"/><path class="st0" d="M 38.2,63.1 51,63.1 44.6,38.7 z"/><path class="st0" d="M0,0v128h128V0H0z M57.5,88.6L53,72.5H36.2l-4.4,16.1h-9.4l16-54.9v-3.8h12.2l17.3,58.7H57.5z M103.5,69h-24 c1.9,19.2,21.2,10,21.2,10V87c0,0-1.3,2.6-14.8,2.6c-13.5,0-16.3-18.3-16.3-18.3v-4.7c0,0,1.3-22,17.3-22 c16,0,16.5,14.6,16.5,14.6V69z"/></svg>

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.