diff --git a/.github/scripts/build_assets/arg_getters.py b/.github/scripts/build_assets/arg_getters.py index b48e53e5..fe2893a2 100644 --- a/.github/scripts/build_assets/arg_getters.py +++ b/.github/scripts/build_assets/arg_getters.py @@ -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() \ No newline at end of file diff --git a/.github/scripts/generate_screenshot_markdown.py b/.github/scripts/generate_screenshot_markdown.py index 2a4f0872..e5a51613 100644 --- a/.github/scripts/generate_screenshot_markdown.py +++ b/.github/scripts/generate_screenshot_markdown.py @@ -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)) + diff --git a/.github/workflows/build_icons.yml b/.github/workflows/build_icons.yml index 5fa09ef4..b3e821e1 100644 --- a/.github/workflows/build_icons.yml +++ b/.github/workflows/build_icons.yml @@ -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 diff --git a/.github/workflows/peek_icons.yml b/.github/workflows/peek_icons.yml index c260d6b0..15b93fb9 100644 --- a/.github/workflows/peek_icons.yml +++ b/.github/workflows/peek_icons.yml @@ -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<> $GITHUB_ENV - python ./.github/scripts/generate_screenshot_markdown.py "%IMG_URLS%" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - shell: cmd + echo 'DETAILED_IMGS_MARKDOWN<> $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)}} diff --git a/devicon.json b/devicon.json index 3547554a..a20801b9 100644 --- a/devicon.json +++ b/devicon.json @@ -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": [ diff --git a/icons/testingicon/testingicon-original.svg b/icons/testingicon/testingicon-original.svg deleted file mode 100644 index a3836e54..00000000 --- a/icons/testingicon/testingicon-original.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/testingicon/testingicon-plain.svg b/icons/testingicon/testingicon-plain.svg deleted file mode 100644 index 66979bf3..00000000 --- a/icons/testingicon/testingicon-plain.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/testingicon/testingicon.eps b/icons/testingicon/testingicon.eps deleted file mode 100644 index de5ae6d1..00000000 Binary files a/icons/testingicon/testingicon.eps and /dev/null differ diff --git a/icons/testingicon2/testingicon2-original.svg b/icons/testingicon2/testingicon2-original.svg deleted file mode 100644 index a3836e54..00000000 --- a/icons/testingicon2/testingicon2-original.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/testingicon2/testingicon2-plain.svg b/icons/testingicon2/testingicon2-plain.svg deleted file mode 100644 index 66979bf3..00000000 --- a/icons/testingicon2/testingicon2-plain.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/icons/testingicon2/testingicon2.eps b/icons/testingicon2/testingicon2.eps deleted file mode 100644 index de5ae6d1..00000000 Binary files a/icons/testingicon2/testingicon2.eps and /dev/null differ