Can this be used to sync JSON files by creating commits? #162
-
I am new to GitHub actions. I am looking to create a workflow that would allow me the following:
I would really appreciate your help on this. |
Beta Was this translation helpful? Give feedback.
Answered by
stefanzweifel
May 20, 2021
Replies: 1 comment 4 replies
-
This should be possible. But The logic that detects if a line has been added or removed and then updates a JSON file is up to you. Here is a very basic example of how such a workflow could look like: name: Demo
on:
push:
paths:
- 'folder/**.json'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Update JSON Files
run: ./path/to/binary/to/run/your/logic
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Changed JSON Files |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
zefir-git
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should be possible. But
git-auto-commit
will only play a small role in that workflow.git-auto-commit
will only detect changes in files, commit them and push them pack to GitHub.The logic that detects if a line has been added or removed and then updates a JSON file is up to you.
Here is a very basic example of how such a workflow could look like: