Skip to content

Commit ea2d067

Browse files
committed
chore: add workflows/emoji-data-updater
1 parent e7affa0 commit ea2d067

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: emoji-data-updater
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 2 * * 5"
7+
8+
jobs:
9+
update-emoji-json:
10+
runs-on: ubuntu-latest
11+
env:
12+
VERSION:
13+
RELEASE_URL:
14+
WORKING_DIR: scripts/emoji_generator
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
- name: Fetch Latest Emojibase Version
19+
id: fetch_version
20+
run: |
21+
RELEASE_INFO=$(curl -s https://api.github.com/repos/milesj/emojibase/releases/latest)
22+
LATEST_RELEASE=$(echo "$RELEASE_INFO" | jq -r '.tag_name')
23+
RELEASE_URL=$(echo "$RELEASE_INFO" | jq -r '.html_url')
24+
echo "VERSION=$(echo \"$LATEST_RELEASE\" | grep -oP '(?<=emojibase-data@)\d+\.\d+\.\d+')" >> $GITHUB_ENV
25+
echo "RELEASE_URL=$RELEASE_URL" >> $GITHUB_ENV
26+
27+
- name: Setup Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.10.6"
31+
32+
- name: Install Dependencies
33+
run: |
34+
pip install --upgrade pip
35+
pip install poetry
36+
poetry config virtualenvs.create true
37+
poetry install --no-root
38+
39+
- name: Run Emoji Update Script
40+
env:
41+
PYTHONUNBUFFERED: 1
42+
EMOJI_VERSION: ${{ env.VERSION }}
43+
run: poetry run python ${{ env.WORKING_DIR }}/emoji_generator/generator.py
44+
45+
- name: Push Changes and Create PR
46+
uses: peter-evans/create-pull-request@v7
47+
with:
48+
commit-message: "chore(deps): update emoji.json to emojibase-data@${{ env.VERSION }}"
49+
title: "Update emoji.json to emojibase-data@${{ env.VERSION }}"
50+
body: |
51+
This PR updates emoji.json to the latest version of emojibase-data: `emojibase-data@${{ env.VERSION }}`.
52+
53+
You can review the release notes [here](${{ env.RELEASE_URL }}).
54+
branch: dependencies/emoji-base-updates
55+
author: GitHub <[email protected]>
56+
delete-branch: true

0 commit comments

Comments
 (0)