1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-31 10:02:12 +02:00
Files
devicon/.github/workflows/check_icon_pr.yml
David Leal 2b9faadbec Update many of the actions to their latest version (#1731)
* Update many of the actions to their latest version

* Fix CodeQL action

* Use the latest version for all images

* Whoops

* Use Ubuntu for the Peek Icons workflow

* Fix Peek Icons action

* Remove token

* chore: apply suggestions from code review

Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com>

---------

Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com>
2023-04-28 10:21:27 -06:00

54 lines
1.7 KiB
YAML

name: Check Icon PR
on: pull_request
jobs:
check:
name: Check the `devicon.json` and the SVGs' quality
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.title, 'new icon') || startsWith(github.event.pull_request.title, 'update icon') # only checks icon PR
steps:
- uses: actions/checkout@v3
- name: Check if PR is develop
if: ${{ github.base_ref != 'develop' }}
run: |
echo -e "The PR's base branch is \`${{ github.base_ref }}\`, but should be \`develop\`\nPlease change the PR so that it's based on, and merged into \`develop\`" > ./err_messages.txt
echo "wrong_branch=true" >> $GITHUB_ENV
- uses: actions/setup-python@v4
if: ${{ !env.wrong_branch }}
with:
python-version: 3.8
- name: Install dependencies
if: ${{ !env.wrong_branch }}
run: |
python -m pip install --upgrade pip
pip install -r ./.github/scripts/requirements.txt
- name: Run the check_svg script
if: ${{ !env.wrong_branch }}
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@v3
if: success()
with:
name: err_messages
path: ./err_messages.txt
- name: Save the pr num in an artifact
shell: bash
if: success()
env:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt
- name: Upload the pr num
uses: actions/upload-artifact@v3
if: success()
with:
name: pr_num
path: ./pr_num.txt