-
Notifications
You must be signed in to change notification settings - Fork 2.3k
182 lines (153 loc) · 7.37 KB
/
post_peek_screenshot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: Post the screenshots into a comment from Peek Icons workflow
on:
workflow_run:
workflows: ['Peek Icons']
types:
- completed
jobs:
post_screenshots_in_comment:
name: Post the screenshot
runs-on: ubuntu-18.04
if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'skipped'
env:
# three possible values: 'skipped', 'success', 'failure'
# have to print github.event to console to see these values
# note: can't use this env variable up in the if statement above for some reason.
# I don't think it's an ordering issue cause it seems 'if' is auto evaluate first
PEEK_STATUS: ${{ github.event.workflow_run.conclusion }}
steps:
- name: Check state of last run
run: echo $PEEK_STATUS
- name: Download workflow artifact
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: peek_icons.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Read the pr_num file
id: pr_num_reader
uses: juliangruber/[email protected]
with:
path: ./pr_num/pr_num.txt
- name: Read the err message file
if: success()
id: err_message_reader
uses: juliangruber/[email protected]
with:
path: ./err_messages/err_messages.txt
# using this trigger allowed us to access secrets
- name: Upload screenshot of the SVGs gotten from the artifacts
id: svgs_overview_img_step
if: env.PEEK_STATUS == 'success' && success()
uses: devicons/[email protected]
with:
path: ./screenshots/new_svgs.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload zoomed in screenshot of the SVGs gotten from the artifacts
id: svgs_detailed_img_step
uses: devicons/[email protected]
if: env.PEEK_STATUS == 'success' && success()
with:
path: ./screenshots/new_svg_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload screenshot of the newly made icons gotten from the artifacts
id: icons_overview_img_step
if: env.PEEK_STATUS == 'success' && success()
uses: devicons/[email protected]
with:
path: ./screenshots/new_icons.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload zoomed in screenshot of the newly made icons gotten from the artifacts
id: icons_detailed_img_step
uses: devicons/[email protected]
if: env.PEEK_STATUS == 'success' && success()
with:
path: ./screenshots/new_icon_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Upload zoomed in screenshot of the colored icons gotten from the artifacts
id: colored_icons_detailed_img_step
uses: devicons/[email protected]
if: env.PEEK_STATUS == 'success' && success()
with:
path: ./screenshots/new_colored_icon_*.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Comment on the PR about the result - Success
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: env.PEEK_STATUS == 'success' && success()
env:
MESSAGE: |
Hi there,
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).
Here are the SVGs as intepreted by Icomoon when we upload the files:
{0}
Here are the zoomed-in screenshots of the added icons as **SVGs**:
{1}
Here are the icons that will be generated by Icomoon:
{2}
Here are the zoomed-in screenshots of the added icons as **icons**:
{3}
Here are the colored versions:
{4}
{5}
The maintainers will now check for:
1. The number of Glyphs matches the number of SVGs that were selected.
2. The icons (second group of pictures) look the same as the SVGs (first group of pictures).
3. The icons are of high quality (legible, matches the official logo, etc.)
In case of font issues, it might be caused by Icomoon not accepting strokes in the SVGs. Check this [doc](https://icomoon.io/#faq/importing) for more details and fix the issues as instructed by Icomoon and update this PR once you are done.
Thank you for contributing to Devicon! I hope that your icons are accepted into the repository.
Note: If the images don't show up, it has been autodeleted by Imgur after 6 months due to our API choice.
Cheers,
Peek Bot :blush:
with:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: >
${{
format(
env.MESSAGE,
fromJSON(steps.svgs_overview_img_step.outputs.markdown_urls)[0],
join(fromJSON(steps.svgs_detailed_img_step.outputs.markdown_urls), ' '),
fromJSON(steps.icons_overview_img_step.outputs.markdown_urls)[0],
join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), ' '),
join(fromJSON(steps.colored_icons_detailed_img_step.outputs.markdown_urls), ' '),
steps.err_message_reader.outputs.content
)
}}
- name: Comment on the PR about the result - Failure
if: env.PEEK_STATUS == 'failure'
uses: jungwinter/comment@v1 # let us comment on a specific PR
env:
MESSAGE: |
Hi there,
I'm Devicons' Peek Bot and it seems we've ran into a problem.
```
{0}
```
Make sure that:
- Your svgs are named and added correctly to the /icons folder as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#orgGuidelines).
- Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon)
- Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview)
I will retry once everything is fixed. If I still fail or there are other error, the maintainers will investigate.
Best of luck,
Peek Bot :relaxed:
with:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }}
- name: Comment on the PR about the result - Failure
if: failure()
uses: jungwinter/comment@v1 # let us comment on a specific PR
env:
MESSAGE: |
Hi there,
I'm Devicons' Peek Bot and we've ran into a problem with the `post_peek_screenshot` workflow.
The maintainers will take a look and fix the issue. Please wait for further instructions.
Thank you,
Peek Bot :relaxed:
with:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: env.MESSAGE