-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 1.11 KB
/
JSONmerge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Merge JSON Files
on:
schedule:
- cron: '1 */6 * * *' # run the task at the first minute of every 6th hour.
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
- name: Install dependencies
run: pip install -r requirements.txt # If you have any requirements
- name: Run Python script
run: python json_merger.py
working-directory: ${{ github.workspace }} # Ensure the script runs in the correct directory
- name: Commit 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 "Create merged_data.json"
git commit -m "Merge and update JSON files"
git pull origin main || echo "No remote changes to pull"
git push