Skip to content

Update Font List

Update Font List #77

name: Update Font List
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
fetch_fonts:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Fetch Fonts
run: |
scripts/get_fonts_list.py
env:
API_KEY: ${{ secrets.MINIMAL_VUE_SNT_KEY }}
- name: Check if File Changed
id: check_file_changed
run: |
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep 'fontsv2.json'; then
echo "File has changed."
echo "::set-output name=file_changed::true"
else
echo "File has not changed."
echo "::set-output name=file_changed::false"
fi
- name: Update Version in Manifest
if: steps.check_file_changed.outputs.file_changed == 'true'
run: |
scripts/increment_minor_version.py
- name: Commit changes
if: steps.check_file_changed.outputs.file_changed == 'true'
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add .
git commit -m 'Update font list'
- name: Create Pull Request
if: steps.check_file_changed.outputs.file_changed == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
committer: GitHub Actions <[email protected]>
author: GitHub Actions <[email protected]>
title: 'Update Font List'
branch: update-font-list
body: This pull request updates the font list.