-
Notifications
You must be signed in to change notification settings - Fork 22
39 lines (33 loc) · 1.02 KB
/
combine-config.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
38
39
name: Combine JSON configuration files
on:
push:
branches:
- 'main'
jobs:
merge_json_files:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Or your preferred version
- name: Install dependencies
run: npm install
- name: Merge JSON files
run: |
node merge-config.js
- name: Commit and push changes
run: |
git config --global user.name "$GIT_USERNAME"
git config --global user.email "$GIT_EMAIL"
git add config.json
git update-index --refresh
git diff-index --quiet HEAD || (git commit -m "Merge JSON files" && git push)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_USERNAME: github-actions[bot]
GIT_EMAIL: github-actions[bot]@users.noreply.github.com