Merge pull request #76 from de-snake/main #112
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: 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 |