Skip to content

Commit

Permalink
add some complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
kchro3 committed Jan 28, 2024
1 parent f9af2f8 commit f5b6724
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/scripts/update_localizations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
import json
import sys
import os


assert os.environ["OPENAI_API_KEY"] is not None


def process_diff(diff_lines):
# Process the diff lines
for line in diff_lines:
# Example: just print each line
print(line)


def main():
# Read from stdin
diff_lines = sys.stdin.readlines()

# Process the diff lines
process_diff(diff_lines)


if __name__ == "__main__":
main()
3 changes: 2 additions & 1 deletion .github/workflows/update_localizations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ jobs:
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
python .github/scripts/update_localizations.py
git fetch origin ${{ github.base_ref }}
git diff FETCH_HEAD...${{ github.sha }} -- Localizable.xcstrings | python .github/scripts/update_localizations.py

0 comments on commit f5b6724

Please sign in to comment.