microsoft/AI-For-Beginners

Public

mirrored fromhttps://github.com/microsoft/AI-For-BeginnersAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
72507ad5e03976fe57b26ef2fb8526cef27734b0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

.github/workflows/co-op-translator.yml

109lines ยท modecode

1name: Co-op Translator
2
3on:
4 push:
5 branches:
6 - main
7
8jobs:
9 co-op-translator:
10 runs-on: ubuntu-latest
11
12 permissions:
13 contents: write
14 pull-requests: write
15
16 steps:
17 - name: Checkout repository
18 uses: actions/checkout@v4
19 with:
20 fetch-depth: 0
21
22 - name: Set up Python
23 uses: actions/setup-python@v4
24 with:
25 python-version: '3.10'
26
27 - name: Install Co-op Translator
28 run: |
29 python -m pip install --upgrade pip
30 pip install co-op-translator
31
32 - name: Run Co-op Translator
33 env:
34 PYTHONIOENCODING: utf-8
35 # Azure AI Service Credentials
36 AZURE_AI_SERVICE_API_KEY: ${{ secrets.AZURE_AI_SERVICE_API_KEY }}
37 AZURE_AI_SERVICE_ENDPOINT: ${{ secrets.AZURE_AI_SERVICE_ENDPOINT }}
38
39 # Azure OpenAI Credentials
40 AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
41 AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
42 AZURE_OPENAI_MODEL_NAME: ${{ secrets.AZURE_OPENAI_MODEL_NAME }}
43 AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }}
44 AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }}
45
46 # OpenAI Credentials
47 OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
48 OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }}
49 OPENAI_CHAT_MODEL_ID: ${{ secrets.OPENAI_CHAT_MODEL_ID }}
50 OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
51 run: |
52 # =====================================================================
53 # IMPORTANT: Set your target languages here (REQUIRED CONFIGURATION)
54 # =====================================================================
55 # Example: Translate to Spanish, French, German. Add -y to auto-confirm.
56 # translate -l "all" -y # <--- MODIFY THIS LINE with your desired languages
57 # translate -l "ar bn bg br cs da de el es fa fi" -nb
58 # translate -l "fr he hi hr hu id it ja" -nb
59 # translate -l "ko lt mo ms mr my ne nl no pa pl" -nb
60 # translate -l "pt ro ru sk sl sr sv sw" -nb
61 # translate -l "th tl tr tw uk ur vi zh hk" -nb
62 translate -l "ar ur tl mr ne pa bn ru mo" -y
63 # translate -l "mr ne pa" -y
64 # translate -l "bn ru mo" -y
65 # translate -l "br it tr el th sv da no" -y
66 # translate -l "el th" -y
67 # translate -l "sv da no" -y
68 # translate -l "fi nl he vi id ms sw hu cs" -y
69 # translate -l "vi id ms" -y
70 # translate -l "sw hu cs" -y
71 # translate -l "sk ro bg sr" -y
72 # translate -l "sr hr sl" -y
73 # translate -l "ja uk my" -y
74 # translate -l "de es fa" -y
75 # translate -l "fr hi ko lt" -y
76 # translate -l "pl pt zh" -y
77 # translate -l "hk tw" -y
78
79 - name: Authenticate GitHub App
80 id: generate_token
81 uses: tibdex/github-app-token@v1
82 with:
83 app_id: ${{ secrets.GH_APP_ID }}
84 private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
85
86 - name: Create Pull Request with translations
87 uses: peter-evans/create-pull-request@v5
88 with:
89 token: ${{ steps.generate_token.outputs.token }}
90 commit-message: "๐ŸŒ Update translations via Co-op Translator"
91 title: "๐ŸŒ Update translations via Co-op Translator"
92 body: |
93 This PR updates translations for recent changes merged into the `main` branch.
94
95 ### ๐Ÿ“‹ Summary of Changes
96 - Translated markdown content has been added under the `translations/` directory
97 - Translated images (if applicable) have been generated in the `translated_images/` directory
98
99 ๐Ÿ” Co-op Translator ensures that changes in links, structure, or inline elements in the original content are automatically reflected in all translated files.
100
101 ---
102 ๐ŸŒ This pull request was automatically generated by [Co-op Translator](https://github.com/Azure/co-op-translator), powered by Azure AI.
103
104 branch: update-translations
105 base: main
106 delete-branch: true
107 add-paths: |
108 translations/
109 translated_images/
110