From 61b5d490a51c6a82b404f5f068eab6159c23b87d Mon Sep 17 00:00:00 2001 From: Lucas <86352901+LucasVbr@users.noreply.github.com> Date: Thu, 19 May 2022 23:11:50 +0200 Subject: [PATCH] Create update-readme.yml --- .github/workflows/update-readme.yml | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/update-readme.yml diff --git a/.github/workflows/update-readme.yml b/.github/workflows/update-readme.yml new file mode 100644 index 0000000..6428ced --- /dev/null +++ b/.github/workflows/update-readme.yml @@ -0,0 +1,43 @@ +name: Update README + +on: + schedule: + - cron: '0 12 * * *' # runs at 12:00 UTC everyday + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: checkout repo content + uses: actions/checkout@v2 # checkout the repository content to github runner + + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: '3.7.7' # install the python version needed + + - name: install python packages + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: execute py script + env: + EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }} + EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }} + EMAIL_RECIPIENT: ${{ secrets.EMAIL_RECIPIENT }} + run: python main.py + + - name: commit files + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git commit -m "update data" -a + + - name: push changes + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: main