Skip to content

Update Data

Update Data #28

Workflow file for this run

name: Update Data
on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch: # Allows manually triggering the workflow
jobs:
update:
runs-on: ubuntu-latest
env:
RELEASE_DATE: "2024-08-11"
PROJECT_DIR: ${{ github.workspace }} # Set the project directory using GITHUB_WORKSPACE
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
# Step 6: Dynamically set RELEASE_DATE environment variable
- name: Set release date
run: |
echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV}
# Step 3: Install local package and dependencies
- name: Install dependencies
run: |
pip install -e .
pip install -r requirements.txt
# Step 4: Run all Jupyter notebooks in the ./notebook/ folder
- name: Run Jupyter notebooks
run: python ./NOTEBOOKS/runner.py
# Step 5: Run Pre commit
- name: Run pre-commit hooks
run: pre-commit run --all-files
# # Step 6: Commit changes to a new branch
# - name: Commit changes
# run: |
# git checkout -b data-update
# git add .
# git commit -m "Data update for ${{ env.RELEASE_DATE }}"
# # git push -f
# Step 7: Push changes and create a PR
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Data update as on ${{ env.RELEASE_DATE }}"
committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
signoff: false
base: main
branch: data-update
delete-branch: true
title: "[PanditBot] Updating Repos Data $(date +%Y-%m-%d)"
body: |
This PR contains the data updates.
- "Updated with *${{ env.RELEASE_DATE }}*"
labels: |
report
automated pr
assignees: ptprashanttripathi
reviewers: ptprashanttripathi
team-reviewers: |
developers
qa-team
draft: false
# Final Step : OUTPUT
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"