forked from tenxstudio/devtale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
75 lines (69 loc) · 2.08 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: "devtale-doc"
description: "Automatically document a repository, folder, or file."
branding:
icon: "file-text"
color: "blue"
inputs:
openai_api_key:
description: "Your OpenAI API key."
required: true
path:
description: "Path to your repository, folder, or file."
required: true
recursive:
description: "True if you want to document the full repository. Otherwise False."
required: false
default: false
target_branch:
description: "Base branch name to which the documentation pull request should point."
required: true
save_tales:
description: "True if you want to keep the tale files. Otherwise False to remove them."
required: false
default: false
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install devtale
shell: bash
- name: Document
run: |
if ${{ inputs.recursive }}; then
echo "Documenting repository"
devtale -r -p ${{ inputs.path }} -o ${{ inputs.path }} -f
else
echo "Documenting folder/path"
devtale -p ${{ inputs.path }} -o ${{ inputs.path }} -f
fi
env:
OPENAI_API_KEY: ${{ inputs.openai_api_key }}
shell: bash
- name: Clean Documentation Files
run: |
if ! ${{ inputs.save_tales }}; then
rm -f *.py.json
rm -f *.php.json
rm -f *.go.json
rm -f *.js.json
rm -f *.ts.json
rm -f *.tsx.json
rm -f *folder_level.json
rm -f *root_level.json
fi
shell: bash
- name: Push PR
uses: peter-evans/create-pull-request@v5
with:
commit-message: add docstrings
title: "[devtale] Add documentation"
body: This PR incorporates automatically generated documentation into previously undocumented code files.
branch: devtale/documentation
base: ${{ inputs.target_branch }}
delete-branch: true