-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
59 lines (49 loc) · 1.5 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 'Auto Translate Readme'
description: 'Automatically translate the language of README via Github Action'
author: 'https://github.com/Lin-jun-xiang'
branding:
icon: "book-open"
color: "red"
inputs:
token:
description: 'Secrets Token to authorize bot account'
required: true
g4f_provider:
description: 'gp4free provider'
required: true
langs:
description: 'Languages for README'
required: true
runs:
using: "composite"
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 3
token: ${{ inputs.token }}
- name: Set Up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Dependencies
shell: bash
run: |
pip install PyExecJS
pip install -U g4f
pip install --upgrade tenacity
- name: Translate README
shell: bash
working-directory: .
run: |
export PROVIDER=${{ inputs.g4f_provider }}
export LANGS=${{ inputs.langs }}
python $GITHUB_ACTION_PATH/translation.py
- name: Git Commit
shell: bash
working-directory: .
run: |
git config --global user.email "[email protected]";
git config --global user.name "Continuous Integration"
chmod +x $GITHUB_ACTION_PATH/commit.sh
bash $GITHUB_ACTION_PATH/commit.sh