|
| 1 | +name: Peek Icons |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + types: [labeled] |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + name: Get Fonts From Icomoon |
| 8 | + if: contains(github.event.pull_request.labels.*.name, 'bot:peek') |
| 9 | + runs-on: windows-2019 |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + - name: Setup Python v3.8 |
| 13 | + uses: actions/setup-python@v2 |
| 14 | + with: |
| 15 | + python-version: 3.8 |
| 16 | + - name: Install dependencies |
| 17 | + run: | |
| 18 | + python -m pip install --upgrade pip |
| 19 | + pip install -r ./.github/scripts/requirements.txt |
| 20 | + - name: Run icomoon_peek.py |
| 21 | + env: |
| 22 | + PR_TITLE: ${{ github.event.pull_request.title }} |
| 23 | + shell: cmd |
| 24 | + run: > |
| 25 | + python ./.github/scripts/icomoon_peek.py |
| 26 | + ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json |
| 27 | + ./devicon.json ./icons ./ --headless --pr_title "%PR_TITLE%" |
| 28 | + - name: Upload geckodriver.log for debugging purposes |
| 29 | + uses: actions/upload-artifact@v2 |
| 30 | + if: failure() |
| 31 | + with: |
| 32 | + name: geckodriver-log |
| 33 | + path: ./geckodriver.log |
| 34 | + - name: Upload screenshot of the newly made icons |
| 35 | + id: icons_overview_img_step |
| 36 | + uses: devicons/public-upload-to-imgur@v2.1 |
| 37 | + if: success() |
| 38 | + with: |
| 39 | + path: ./screenshots/new_icons.png |
| 40 | + client_id: ${{secrets.IMGUR_CLIENT_ID}} |
| 41 | + - name: Upload zoomed in screenshot of the newly made icons |
| 42 | + id: icons_detailed_img_step |
| 43 | + uses: devicons/public-upload-to-imgur@v2.1 |
| 44 | + if: success() |
| 45 | + with: |
| 46 | + path: ./screenshots/screenshot_*.png |
| 47 | + client_id: ${{secrets.IMGUR_CLIENT_ID}} |
| 48 | + - name: Generate the markdowns for the screenshot and put it in the DETAILED_IMGS_MARKDOWN env var |
| 49 | + if: success() |
| 50 | + env: |
| 51 | + IMG_URLS: ${{ steps.icons_detailed_img_step.outputs.imgur_urls }} |
| 52 | + run: | |
| 53 | + echo 'DETAILED_IMGS_MARKDOWN<<EOF' >> $GITHUB_ENV |
| 54 | + python ./.github/scripts/generate_screenshot_markdown.py >> $GITHUB_ENV |
| 55 | + echo 'EOF' >> $GITHUB_ENV |
| 56 | + shell: bash |
| 57 | + - name: Comment on the PR about the result |
| 58 | + if: success() |
| 59 | + uses: github-actions-up-and-running/pr-comment@v1.0.1 |
| 60 | + env: |
| 61 | + OVERVIEW_IMG_URL: ${{ fromJSON(steps.icons_overview_img_step.outputs.imgur_urls)[0] }} |
| 62 | + MESSAGE: | |
| 63 | + Hi! |
| 64 | +
|
| 65 | + I'm Devicons' Peek Bot and I just peeked at the icons that you wanted to add using [icomoon.io](https://icomoon.io/app/#/select). |
| 66 | + Here is the result below: |
| 67 | +
|
| 68 | +  |
| 69 | +
|
| 70 | + Here are the zoomed-in screenshots of the added icons: |
| 71 | + {1} |
| 72 | +
|
| 73 | + Note: If the images don't show up, it's probably because it has been autodeleted by Imgur after 6 months due to our API choice. |
| 74 | +
|
| 75 | + The maintainers will now take a look at it and decide whether to merge your PR. |
| 76 | +
|
| 77 | + Thank you for contributing to Devicon! I hope everything works out and your icons are accepted into the repo. |
| 78 | +
|
| 79 | + Cheers :), |
| 80 | + |
| 81 | + Peek Bot |
| 82 | + with: |
| 83 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + message: ${{format(env.MESSAGE, env.OVERVIEW_IMG_URL, env.DETAILED_IMGS_MARKDOWN)}} |
| 85 | + - name: Comment on the PR about the result |
| 86 | + if: failure() |
| 87 | + uses: github-actions-up-and-running/pr-comment@v1.0.1 |
| 88 | + env: |
| 89 | + MESSAGE: | |
| 90 | + Hi! |
| 91 | +
|
| 92 | + I'm Devicons' Peek Bot and it seems we've ran into a problem. I'm supposed to check your svgs but I couldn't do my task due to an issue. |
| 93 | +
|
| 94 | + Can you please double check and fix the possible issues below: |
| 95 | +
|
| 96 | + - Your svgs are named and added correctly to the /icons folder as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#orgGuidelines). |
| 97 | + - Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon) |
| 98 | + - Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview) |
| 99 | +
|
| 100 | + Once everything is fixed, the maintainers will try again. If I still fail, the maintainers will investigate what cause this problem. |
| 101 | +
|
| 102 | + Thank you for your help :smile: |
| 103 | +
|
| 104 | + Cheers :), |
| 105 | + |
| 106 | + Peek Bot |
| 107 | + with: |
| 108 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 109 | + message: ${{env.MESSAGE}} |
0 commit comments