-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (61 loc) · 2.06 KB
/
pilot.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
name: Doc-Pilot
on: [push, pull_request]
permissions:
actions: read
contents: write
jobs:
run-docstring-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{secrets.GITHUB_TOKEN}}
path: DocPilot
submodules: "recursive"
ref: ${{github.head_ref}}
fetch-depth: 100
- name: Fetch Commit Changes
id: fetch_changes
run: |
cd DocPilot
# files changed can be accessed through ${HOME}/files.json
git diff HEAD~1 HEAD --output="diff.txt"
- name: Install Python Clients
run: |
pip install anthropic
pip install pre-commit
- name: Run Claude Magic
run: |
cd DocPilot
python3 src/integration.py ${{secrets.ANTHROPIC_API_KEY}}
rm -rf diff.txt temp.txt
- name: Check for changes 📝
id: check
run: |
cd DocPilot
if [[ -n "$(git status --porcelain)" ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Run Linter Bot
continue-on-error: true
run: |
cd DocPilot
pre-commit run -a
- name: Set up Bot Credentials
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git config --global credential.helper store
git config --global core.askPass ""
- name: Add Docstring to files
if: steps.check.outputs.changes == 'true'
run: |
cd DocPilot
export GITHUB_TOKEN=$GITHUB_TOKEN
git add .
git commit -m "add docstring"
git push
add-documentation:
name: trigger doc-builder for project
uses: ./.github/workflows/doc-builder.yml
needs: run-docstring-integration