-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.json diff=gron |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: Download and push autocomplete.json | |
on: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
jobs: | ||
|
@@ -18,7 +19,13 @@ jobs: | |
- name: Commit autocomplete.json | ||
if: steps.verify_diff.outputs.changed == 'true' | ||
run: | | ||
git config --global user.name 'Github Actions' | ||
git config --global user.email '[email protected]' | ||
git commit -am "Automated download" | ||
sudo apt install --no-install-recommends -y gron | ||
git config diff.gron.textconv "f(){ gron --no-sort \$1 | sed -E 's/\\[[0-9]+\\]//g' | sed -E 's/^json = ..;$//g' ; }; f" | ||
git config user.name 'Github Actions' | ||
git config user.email '[email protected]' | ||
echo "Automated download" > commit_msg.txt | ||
echo "" >> commit_msg.txt | ||
git diff -w --unified=0 sozluk/v12/src/v12.autocomplete.json | sed -E 's/^@.*//g' | sed -E 's/^-$//g' | sed -E 's/^$//g' >> commit_msg.txt | ||
git add sozluk/v12/src/v12.autocomplete.json | ||
git commit -F commit_msg.txt | ||
git push |