-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (33 loc) · 979 Bytes
/
run_bot.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: My Workflow Run Bot
on:
push:
branches: [master]
workflow_dispatch: # for manual workflow trigger
schedule:
- cron: "0 * * * *" # runs at every one hours
jobs:
run-python-script:
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install packages from requirements.txt
run: pip install -r requirements.txt
- name: Run script
env:
TOKEN: ${{ secrets.TOKEN }}
API_NEWS: ${{ secrets.API_NEWS }}
run: |
python main.py
git config --global user.email "${{ secrets.USER_EMAIL }}"
git config --global user.name "${{ secrets.USER_NAME }}"
git add .tmp
git commit -m "Update Text News"
git push origin master