File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Translate README
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ paths :
8
+ - ' README.md'
9
+
10
+ jobs :
11
+ translate :
12
+ runs-on : ubuntu-latest
13
+
14
+ steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v2
17
+
18
+ - name : Translate README.md to Spanish
19
+ run : |
20
+ TEXT=$(cat README.md)
21
+ TRANSLATED_TEXT=$(curl -X POST "https://libretranslate.com/translate" \
22
+ -H "Content-Type: application/json" \
23
+ -d "{\"q\": \"$TEXT\", \"source\": \"en\", \"target\": \"es\"}" \
24
+ | jq .translatedText)
25
+ echo "$TRANSLATED_TEXT" > README.es.md
26
+
27
+ - name : Commit and push translated README
28
+ run : |
29
+ git config --local user.email "[email protected] "
30
+ git config --local user.name "GitHub Action"
31
+ git add README.es.md
32
+ git commit -m "Add translated README.es.md"
33
+ git push
You can’t perform that action at this time.
0 commit comments