Monday Fights Downloader #106
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: Monday Fights Downloader | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '40 20 * * MON' # UTC time ten minutes after Monday Fight (summer time is UTC+2 and should contain 40 19 * * MON while winter 40 20 * * MON) | |
jobs: | |
echo-input: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 19 | |
- name: Use token | |
env: | |
TOKEN: ${{ secrets.MONDAY_FIGHTS_TOKEN }} # we need personal token because default GITHUB_TOKEN never triggers new events so pages would not be rebuilt | |
run: | | |
# Download Monday Fights | |
cd Scripts | |
node downloadMF.mjs | |
git config --global user.name 'Bebul BOT' | |
git config --global user.email 'Bebul@users.noreply.github.com' | |
if git diff --exit-code --quiet; then | |
echo Up to date, nothing to commit! | |
else | |
git commit -am "Regular Monday Fights tournament download" | |
git push | |
fi |