summaryrefslogtreecommitdiff
path: root/.github/workflows/update-emojis.yml
blob: 79e5fc9c95f696f2b13776d633ac15dbd60f673a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Updates the emoji/glyph list in src/caelestia/data/emojis.txt

name: Update emojis

on:
    workflow_dispatch:
    schedule:
        - cron: "0 0 * * 0"

jobs:
    update:
        runs-on: ubuntu-latest

        permissions:
            contents: write

        steps:
            - uses: actions/checkout@v4

            - name: Setup python
              uses: actions/setup-python@v5
              with:
                  python-version: "3.x"

            - name: Install dependencies
              run: |
                  python -m pip install --upgrade pip
                  pip install .

            - name: Fetch emojis
              run: ./run.sh emoji -f

            - name: Check for changes
              id: check
              run: echo modified=$(git diff --exit-code src/caelestia/data/emojis.txt &>/dev/null && echo 'false' || echo 'true') >> $GITHUB_OUTPUT

            - name: Commit and push changes
              if: steps.check.outputs.modified == 'true'
              uses: EndBug/add-and-commit@v9
              with:
                  add: src/caelestia/data/emojis.txt
                  default_author: github_actions
                  message: "[CI] emojis: update data"