1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-30 09:40:04 +02:00

Update the check-bot (#970)

* Add check for strokes in check-bot

* Add check for svg file name

* Update gulpfile to remove x and y of svg elem

* Revert name changes to err file

* check-bot now check devicon object as well

* Fixed minor bugs

* Improve logging in check_icon

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Thomas Bui
2022-03-13 15:02:41 -07:00
committed by GitHub
parent 5153e0f0da
commit bb589370da
9 changed files with 221 additions and 194 deletions

View File

@@ -1,9 +1,10 @@
name: Check SVGs On PR
name: Check Icon PR
on: pull_request
jobs:
check:
name: Check the SVGs' quality
name: Check the `devicon.json` and the SVGs' quality
runs-on: ubuntu-18.04
if: startsWith(github.event.pull_request.title, 'new icon') # only checks icon PR
steps:
- uses: actions/checkout@v2
@@ -11,24 +12,17 @@ jobs:
with:
python-version: 3.8
- name: Install dependencies
run: python -m pip install --upgrade pip
- name: Get Changed Files and generate files_added.json & files_modified.json
uses: lots0logs/gh-action-get-changed-files@2.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run the check_svg script
run: >
python ./.github/scripts/check_svgs_on_pr.py $HOME/files_added.json $HOME/files_modified.json
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: python ./.github/scripts/check_icon_pr.py "$PR_TITLE" ./icons ./devicon.json
- name: Upload the err messages
uses: actions/upload-artifact@v2
if: success()
with:
name: svg_err_messages
path: ./svg_err_messages.txt
name: err_messages
path: ./err_messages.txt
- name: Save the pr num in an artifact
shell: bash

View File

@@ -1,7 +1,7 @@
name: Post the result of a SVG Check into its PR.
name: Post the result of the check_icon_pr workflow into its PR.
on:
workflow_run:
workflows: ['Check SVGs On PR']
workflows: ['Check Icon PR']
types:
- completed
jobs:
@@ -18,7 +18,7 @@ jobs:
if: success()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: peek_icons.yml
workflow: check_icon_pr.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Read the pr_num file
@@ -33,30 +33,27 @@ jobs:
id: err_message_reader
uses: juliangruber/read-file-action@v1.0.0
with:
path: ./svg_err_messages/svg_err_messages.txt
path: ./err_messages/err_messages.txt
- name: Comment on the PR about the result - SVG Error
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success() && (steps.err_message_reader.outputs.content != '0' && steps.err_message_reader.outputs.content != '1')
if: success() && (steps.err_message_reader.outputs.content != '')
env:
MESSAGE: |
Hi!
I'm Devicons' SVG-Checker Bot and it seems we have some issues with your SVGs.
I'm the `check-bot` and we have some issues with your PR:
Here is what went wrong:
```
{0}
```
For more reference on why these are errors, check out our [CONTRIBUTING guide](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#svgStandards)
Check our [CONTRIBUTING guide](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#svgStandards) for more details regarding these errors.
Please address these issues. When you update this PR, I will check your SVGs again.
Thanks for your help,
SVG-Checker Bot :smile:
PS. One day, I will be smart enough to fix these errors for you :persevere:. Until then, I can only point them out.
with:
type: create
issue_number: ${{ steps.pr_num_reader.outputs.content }}