Update Anime List #260
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: Update Anime List | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
push: | |
pull_request: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%B %d, %Y %I:%M %p')" >> $GITHUB_OUTPUT | |
- name: Check Out Repo | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install Requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Update Anime IDs | |
run: python update_anime_ids.py | |
- name: Check Diff | |
id: verify_diff | |
run: | | |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Commit & Push Changes | |
if: steps.verify_diff.outputs.changed == 'true' | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add -A | |
git commit -m "Update at ${{ steps.date.outputs.date }} UTC" -a | |
git push origin master | |
- name: Discord Failure Notification | |
uses: Kometa-Team/discord-notifications@master | |
if: failure() | |
with: | |
webhook_id_token: ${{ secrets.BUILD_WEBHOOK }} | |
message: <@&1079153184007790652> | |
title: "${{ secrets.REPO_NAME }}: **Run Failed**" | |
url: https://github.com/Kometa-Team/${{ secrets.REPO_NAME }}/actions/runs/${{ github.run_id }} | |
color: 14879811 | |
username: Kobota | |
avatar_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/logo.png | |
author: GitHub | |
author_icon_url: https://raw.githubusercontent.com/Kometa-Team/Kometa/nightly/.github/git.png |