Python Script Runner #438
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Python Script Runner | |
on: | |
schedule: ## schedule job at 11.30 AM UTC time daily | |
- cron: '30 11 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ | |
steps: | |
- name: Chekout the repo | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install beautifulsoup4 | |
pip install lxml | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run python script | |
run: | | |
python3 ./script/DataScrapper.py | |
- name: Create PR | |
id: cpr_step | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.PR_MERGING_TOKEN }} | |
delete-branch: true | |
base: main | |
branch: add-data-from-github-action | |
title: add new data from github action | |
body: add new data from github action | |
labels: automated-pr | |
commit-message: "add new data from github action run" | |
assignees: Shayokh144 | |
committer: Shayokh144 <[email protected]> | |
branch-suffix: timestamp | |
- name: Merge PR | |
if: steps.cpr_step.outputs.pull-request-operation == 'created' | |
uses: peter-evans/enable-pull-request-automerge@v2 | |
with: | |
token: ${{ secrets.PR_MERGING_TOKEN }} | |
pull-request-number: ${{ steps.cpr_step.outputs.pull-request-number }} | |
merge-method: squash | |
- name: Auto approve | |
if: steps.cpr_step.outputs.pull-request-operation == 'created' | |
uses: juliangruber/approve-pull-request-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
number: ${{ steps.cpr_step.outputs.pull-request-number }} |