name: Generate Emoji Info

on:
  - push

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Generate
        run: |
          node build.js

      - name: Check Workspace
        id: workspace-check
        run: echo "::set-output name=status::$(git status -s)"

      - name: Generate new commit
        if: steps.workspace-check.outputs.status
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add -A
          git commit -m "build: update emoji info"
          git push origin main
