Skip to content

Commit 3544e15

Browse files
authored
Merge pull request #398 from devicons/TB_actionTest
Add the public-upload-to-imgur action
2 parents 8ebba86 + 4ec9d85 commit 3544e15

2 files changed

Lines changed: 42 additions & 23 deletions

File tree

.github/workflows/build_icons.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,32 @@ jobs:
2626
with:
2727
name: geckodriver-log
2828
path: ./geckodriver.log
29-
- name: Upload screenshot of the newly made icons
30-
uses: actions/upload-artifact@v2
31-
if: ${{success()}}
32-
with:
33-
name: new_icons
34-
path: ./new_icons.png
3529
- name: Build devicon.min.css
3630
if: ${{ success() }}
3731
run: npm run build-css
32+
- name: Upload screenshot of the newly made icons
33+
id: imgur_step
34+
uses: devicons/public-upload-to-imgur@v1
35+
if: ${{success()}}
36+
with:
37+
img_path: ./new_icons.png
38+
client_id: ${{secrets.IMGUR_CLIENT_ID}}
3839
- name: Create Pull Request
3940
if: ${{ success() }}
4041
uses: peter-evans/create-pull-request@v3
42+
env:
43+
MESSAGE: |
44+
Automated font-building task ran by GitHub Actions bot. This PR built new font files and devicon.css file.
45+
46+
Here are all the files that were built:
47+
48+
![Files Built]({0})
49+
50+
More information can be found in the GitHub Action logs for this workflow.
4151
with:
4252
branch: 'master-build-result'
4353
base: 'master'
4454
commit-message: 'Built new icons, icomoon.json and devicon.css'
4555
title: 'bot:build new icons, icomoon.json and devicon.css'
46-
body: 'Automated font-building task ran by GitHub Actions bot'
56+
body: ${{ format(env.MESSAGE, steps.imgur_step.outputs.imgur_url ) }}
4757
delete-branch: true

.github/workflows/peek_icons.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/setup-python@v2
1717
with:
1818
python-version: 3.8
19-
- name: Install dependencies (python, pip)
19+
- name: Install dependencies
2020
run: |
2121
python -m pip install --upgrade pip
2222
pip install -r ./.github/scripts/requirements.txt
@@ -29,22 +29,31 @@ jobs:
2929
name: geckodriver-log
3030
path: ./geckodriver.log
3131
- name: Upload screenshot of the newly made icons
32-
uses: actions/upload-artifact@v2
32+
id: imgur_step
33+
uses: devicons/public-upload-to-imgur@v1
3334
if: ${{success()}}
3435
with:
35-
name: new_icons
36-
path: ./new_icons.png
37-
# - name: Comment on the PR about the result
38-
# uses: github-actions-up-and-running/pr-comment@v1.0.1
39-
# with:
40-
# repo-token: ${{ secrets.GITHUB_TOKEN }}
41-
# message: >
42-
# Hi! I'm Devicons' GitHub Actions Bot!
43-
44-
# I just peeked at the icons that you wanted to add and upload them to the
45-
# [Actions page](https://github.com/devicons/devicon/actions). The maintainers
46-
# will now take a look at it and decide whether to merge your PR.
36+
img_path: ./new_icons.png
37+
client_id: ${{secrets.IMGUR_CLIENT_ID}}
38+
- name: Comment on the PR about the result
39+
uses: github-actions-up-and-running/pr-comment@v1.0.1
40+
env:
41+
IMG_URL: ${{ steps.imgur_step.outputs.imgur_url }}
42+
MESSAGE: |
43+
Hi!
44+
45+
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).
46+
Here is the result below:
47+
48+
![Peeked Icons (top left)]({0})
4749
48-
# Cheers :),
50+
Note: If the image doesn't show up, it's probably because it has been autodeleted by Imgur after 6 months due to our API choice.
51+
52+
The maintainers will now take a look at it and decide whether to merge your PR.
53+
54+
Cheers :),
4955
50-
# Bot
56+
Peek Bot
57+
with:
58+
repo-token: ${{ secrets.GITHUB_TOKEN }}
59+
message: ${{format(env.MESSAGE, env.IMG_URL, env.IMG_URL)}}

0 commit comments

Comments
 (0)