Fetch Tomachi Emojis #13702
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fetch Tomachi Emojis | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 * * * *" | |
jobs: | |
fetch-emojis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ./.github/scripts/fetch-tomachi-emojis/.node-version | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
id: pnpm-install | |
with: | |
run_install: false | |
package_json_file: ./.github/scripts/fetch-tomachi-emojis/package.json | |
- name: Get pnpm store directory (Fetch emojis) | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache (Fetch emojis) | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies (Fetch emojis) | |
working-directory: ./.github/scripts/fetch-tomachi-emojis/ | |
run: | | |
pnpm install --frozen-lockfile --prefer-frozen-lockfile | |
- name: Fetch emojis from Tomachi Emojis | |
working-directory: ./.github/scripts/fetch-tomachi-emojis/ | |
run: pnpm start --output-emojis ../../../icons/ --output-stickers ../../../stickers/ --target-guilds ../../../targetGuilds.json --emojis ../../../emojis.json --stickers ../../../stickers.json | |
env: | |
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }} | |
- name: Get pnpm store directory (Generate README) | |
id: pnpm-cache-generate-readme | |
shell: bash | |
working-directory: ./.github/scripts/generate-readme/ | |
run: | | |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache (Generate README) | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pnpm-cache-generate-readme.outputs.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
working-directory: ./.github/scripts/generate-readme/ | |
run: | | |
pnpm install --frozen-lockfile --prefer-frozen-lockfile | |
- name: Generate README file | |
working-directory: ./.github/scripts/generate-readme/ | |
run: pnpm start --target-emojis ../../../icons/ --target-stickers ../../../stickers/ --output ../../../README.md --target-guilds ../../../targetGuilds.json --emojis ../../../emojis.json --stickers ../../../stickers.json | |
- name: Commit & Push | |
run: | | |
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} | |
git config --global user.name "GitHub Action" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A && git commit -v -m "feat: Fetched emojis from Tomachi Emojis" || true | |
git push origin master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |