File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 32
32
run : |
33
33
echo "files=$(git diff --diff-filter=d --name-only HEAD^ HEAD | grep '\.md$' | grep -v 'cn' | sed -e 's/^/.\//' | tr '\n' ' ')" >> $GITHUB_OUTPUT
34
34
35
+ - name : Read prompt from file
36
+ id : prompt
37
+ run : |
38
+ prompt_value=$(cat .github/workflows/prompt.txt | sed ':a;N;$!ba;s/\n/\\n/g')
39
+ echo "prompt=$prompt_value" >> $GITHUB_OUTPUT
40
+
35
41
- name : Run GPT Translate
36
42
37
43
with :
40
46
inputFiles : " ${{ steps.changed_files.outputs.files }}"
41
47
outputFiles : " docs/cn/**/*.md"
42
48
languages : " Simplified-Chinese"
43
- prompt : " $(cat .github/workflows/ prompt.txt) "
49
+ prompt : " ${{ steps. prompt.outputs.prompt }} "
44
50
basePath : ${{ secrets.BASE_URL }}
Original file line number Diff line number Diff line change 46
46
echo "Markdown Files Missing: ${{ steps.check_missing.outputs.missing_md_files }}"
47
47
echo "JSON Files Missing: ${{ steps.check_missing.outputs.missing_json_files }}"
48
48
49
+ - name : Read prompt from file
50
+ id : prompt
51
+ run : |
52
+ prompt_value=$(cat .github/workflows/prompt.txt | sed ':a;N;$!ba;s/\n/\\n/g')
53
+ echo "prompt=$prompt_value" >> $GITHUB_OUTPUT
54
+
49
55
- name : Run GPT Translate
50
56
51
57
with :
54
60
inputFiles : " ${{ steps.check_missing.outputs.missing_md_files }}${{ steps.check_missing.outputs.missing_json_files }}"
55
61
outputFiles : " docs/cn/**/*.{md,json}"
56
62
languages : " Simplified-Chinese"
57
- prompt : " $(cat .github/workflows/ prompt.txt) "
63
+ prompt : " ${{ steps. prompt.outputs.prompt }} "
58
64
basePath : ${{ secrets.BASE_URL }}
Original file line number Diff line number Diff line change 46
46
echo "Markdown Files Missing: ${{ steps.check_missing.outputs.missing_md_files }}"
47
47
echo "JSON Files Missing: ${{ steps.check_missing.outputs.missing_json_files }}"
48
48
49
+ - name : Read prompt from file
50
+ id : prompt
51
+ run : |
52
+ prompt_value=$(cat .github/workflows/prompt.txt | sed ':a;N;$!ba;s/\n/\\n/g')
53
+ echo "prompt=$prompt_value" >> $GITHUB_OUTPUT
54
+
49
55
- name : Run GPT Translate
50
56
51
57
with :
54
60
inputFiles : " ${{ steps.check_missing.outputs.missing_md_files }}${{ steps.check_missing.outputs.missing_json_files }}"
55
61
outputFiles : " docs/cn/**/*.{md,json}"
56
62
languages : " Simplified-Chinese"
57
- prompt : " $(cat .github/workflows/ prompt.txt) "
63
+ prompt : " ${{ steps. prompt.outputs.prompt }} "
58
64
basePath : ${{ secrets.BASE_URL }}
Original file line number Diff line number Diff line change @@ -11,12 +11,18 @@ jobs:
11
11
steps :
12
12
- uses : actions/checkout@v4
13
13
14
+ - name : Read prompt from file
15
+ id : prompt
16
+ run : |
17
+ prompt_value=$(cat .github/workflows/prompt.txt | sed ':a;N;$!ba;s/\n/\\n/g')
18
+ echo "prompt=$prompt_value" >> $GITHUB_OUTPUT
19
+
14
20
- name : Run GPT Translate
15
21
if : |
16
22
contains(github.event.comment.body, '/gt')
17
23
18
24
with :
19
25
apikey : ${{ secrets.API_KEY }}
20
26
model : ${{ secrets.LLM_MODEL }}
21
- prompt : " $(cat .github/workflows/ prompt.txt) "
27
+ prompt : " ${{ steps. prompt.outputs.prompt }} "
22
28
basePath : ${{ secrets.BASE_URL }}
You can’t perform that action at this time.
0 commit comments