My Workflow Run Bot #10092
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: 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 |