diff --git a/.github/workflows/scrape-tdesktop-api-scheme.yml b/.github/workflows/scrape-tdesktop-api-scheme.yml new file mode 100644 index 00000000..a351382e --- /dev/null +++ b/.github/workflows/scrape-tdesktop-api-scheme.yml @@ -0,0 +1,34 @@ + +on: + schedule: + - cron: '0 12 * * *' # Every day at 12:00 (noon). Ref https://crontab.guru/examples.html +name: Scrape telegram bot API +jobs: + build: + name: Scrape + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + fetch-depth: 1 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Scrape website + run: sudo apt-get install wget && wget -c "https://github.com/telegramdesktop/tdesktop/raw/dev/Telegram/Resources/tl/api.tl" -O "telethon_generator/data/api.tl" + + - name: Open Pull Request + uses: peter-evans/create-pull-request@v3.5.2 + with: + commit-message: > + Regenerate API.tl + title: > + Update API.tl based on the latest changes from tdesktop + body: > + This is an automated PR. Please check the diff, and the action logs, to check for any funky behaviour. + branch: automated/bot-api-update + labels: automated + delete-branch: true