Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the public-upload-to-imgur action #398

Merged
merged 4 commits into from
Dec 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/build_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,32 @@ jobs:
with:
name: geckodriver-log
path: ./geckodriver.log
- name: Upload screenshot of the newly made icons
uses: actions/upload-artifact@v2
if: ${{success()}}
with:
name: new_icons
path: ./new_icons.png
- name: Build devicon.min.css
if: ${{ success() }}
run: npm run build-css
- name: Upload screenshot of the newly made icons
id: imgur_step
uses: devicons/public-upload-to-imgur@v1
if: ${{success()}}
with:
img_path: ./new_icons.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Create Pull Request
if: ${{ success() }}
uses: peter-evans/create-pull-request@v3
env:
MESSAGE: |
Automated font-building task ran by GitHub Actions bot. This PR built new font files and devicon.css file.

Here are all the files that were built:

![Files Built]({0})

More information can be found in the GitHub Action logs for this workflow.
with:
branch: 'master-build-result'
base: 'master'
commit-message: 'Built new icons, icomoon.json and devicon.css'
title: 'bot:build new icons, icomoon.json and devicon.css'
body: 'Automated font-building task ran by GitHub Actions bot'
body: ${{ format(env.MESSAGE, steps.imgur_step.outputs.imgur_url ) }}
delete-branch: true
41 changes: 25 additions & 16 deletions .github/workflows/peek_icons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies (python, pip)
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.github/scripts/requirements.txt
Expand All @@ -29,22 +29,31 @@ jobs:
name: geckodriver-log
path: ./geckodriver.log
- name: Upload screenshot of the newly made icons
uses: actions/upload-artifact@v2
id: imgur_step
uses: devicons/public-upload-to-imgur@v1
if: ${{success()}}
with:
name: new_icons
path: ./new_icons.png
# - name: Comment on the PR about the result
# uses: github-actions-up-and-running/pr-comment@v1.0.1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# message: >
# Hi! I'm Devicons' GitHub Actions Bot!

# I just peeked at the icons that you wanted to add and upload them to the
# [Actions page](https://github.com/devicons/devicon/actions). The maintainers
# will now take a look at it and decide whether to merge your PR.
img_path: ./new_icons.png
client_id: ${{secrets.IMGUR_CLIENT_ID}}
- name: Comment on the PR about the result
uses: github-actions-up-and-running/pr-comment@v1.0.1
env:
IMG_URL: ${{ steps.imgur_step.outputs.imgur_url }}
MESSAGE: |
Hi!

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 is the result below:

![Peeked Icons (top left)]({0})

# Cheers :),
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.

The maintainers will now take a look at it and decide whether to merge your PR.

Cheers :),

# Bot
Peek Bot
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
message: ${{format(env.MESSAGE, env.IMG_URL, env.IMG_URL)}}