Skip to content

Commit 4fce919

Browse files
committed
Clean up the peek_icons.yml
1 parent 3c4e8bc commit 4fce919

2 files changed

Lines changed: 115 additions & 56 deletions

File tree

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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+
![Peeked Icons (top left)]({0})
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}}

.github/workflows/peek_icons.yml

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -25,68 +25,18 @@ jobs:
2525
python ./.github/scripts/icomoon_peek.py
2626
./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json
2727
./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}}
4828
- name:
4929
uses: actions/upload-artifact@v2
30+
if: success()
5031
with:
5132
name: screenshots
5233
path: ./screenshots/*.png
53-
- name: Generate the markdowns for the screenshot and put it in the DETAILED_IMGS_MARKDOWN env var
54-
if: success()
55-
env:
56-
IMG_URLS: ${{ steps.icons_detailed_img_step.outputs.imgur_urls }}
57-
run: |
58-
echo 'DETAILED_IMGS_MARKDOWN<<EOF' >> $GITHUB_ENV
59-
python ./.github/scripts/generate_screenshot_markdown.py >> $GITHUB_ENV
60-
echo 'EOF' >> $GITHUB_ENV
61-
shell: bash
62-
- name: Comment on the PR about the result
63-
if: success()
64-
uses: github-actions-up-and-running/pr-comment@v1.0.1
65-
env:
66-
OVERVIEW_IMG_URL: ${{ fromJSON(steps.icons_overview_img_step.outputs.imgur_urls)[0] }}
67-
MESSAGE: |
68-
Hi!
69-
70-
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).
71-
Here is the result below:
72-
73-
![Peeked Icons (top left)]({0})
74-
75-
Here are the zoomed-in screenshots of the added icons:
76-
{1}
77-
78-
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.
79-
80-
The maintainers will now take a look at it and decide whether to merge your PR.
81-
82-
Thank you for contributing to Devicon! I hope everything works out and your icons are accepted into the repo.
83-
84-
Cheers :),
85-
86-
Peek Bot
34+
- name: Upload geckodriver.log for debugging purposes
35+
uses: actions/upload-artifact@v2
36+
if: failure()
8737
with:
88-
repo-token: ${{ secrets.GITHUB_TOKEN }}
89-
message: ${{format(env.MESSAGE, env.OVERVIEW_IMG_URL, env.DETAILED_IMGS_MARKDOWN)}}
38+
name: geckodriver-log
39+
path: ./geckodriver.log
9040
- name: Comment on the PR about the result
9141
if: failure()
9242
uses: github-actions-up-and-running/pr-comment@v1.0.1

0 commit comments

Comments
 (0)