Skip to content

Update file(s)

Update file(s) #3258

Workflow file for this run

name: Update file(s)
on:
push:
branches: [ main ]
schedule:
- cron: "0 */12 * * *" # run every 2 hours
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Format code
run: black simple.py
- name: Fetch data and update the file(s)
run: python simple.py
- name: Commit updated file(s) back to this repository
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git diff-index --quiet HEAD || git commit -m "[skip ci] Save result of action"
git fetch origin main
git push
# - name: Push file to remote repo
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
# with:
# source_file: nepse_simple.xlsx
# destination_repo: dotehacker/dotehacker.github.io
# user_name: dotehacker
# user_email: rockerritesh4@gmail.com
# target-branch: main