Skip to content

Check new rules

Check new rules #478

name: Check new rules
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
check-webpage:
runs-on: ubuntu-latest
steps:
- name: Fetch webpage and search for rules
id: fetch-webpage
run: |
page=$(curl ${MAGIC_WEBPAGE_URL})
if echo "${page}" | grep -q "${LAST_RULES_URL}"; then
echo "found=true" >> $GITHUB_OUTPUT
else
echo "found=false" >> $GITHUB_OUTPUT
fi
env:
MAGIC_WEBPAGE_URL: ${{ vars.MAGIC_WEBPAGE_URL }}
LAST_RULES_URL: ${{ vars.LAST_RULES_URL }}
- name: Notify new rules
if: steps.fetch-webpage.outputs.found == 'false'
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
New Magic rules found. Update MTG Rules app