Merge JSON Files #1146
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: Merge JSON Files | |
on: | |
schedule: | |
- cron: '39 6 * * *' # 12:09 PM IST (06:39 AM UTC) | |
- cron: '17 10 * * *' # 03:47 PM IST (10:17 AM UTC) | |
- cron: '47 13 * * *' # 07:17 PM IST (01:47 PM UTC) | |
- cron: '17 16 * * *' # 09:47 PM IST (04:17 PM UTC) | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
merge_json: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' # Use the Python version required for your script | |
# Uncomment this section if you have a requirements.txt | |
# - name: Install dependencies | |
# run: | | |
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Run Python script | |
run: python json_merger.py | |
working-directory: ${{ github.workspace }} | |
- name: Commit and push changes | |
run: | | |
git config --local user.email "actions@github.com" | |
git config --local user.name "GitHub Actions" | |
git add data/merged_data.json | |
git commit -m "Merge and update JSON files" || echo "No changes to commit" | |
git pull --rebase origin main | |
git push origin main |