test without ml files #138
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Doc-Pilot | |
on: [push, pull_request] | |
permissions: | |
actions: read | |
contents: write | |
jobs: | |
add-docstring: | |
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 | |
pip install autopep8 | |
- name: Run Claude Magic | |
run: | | |
cd DocPilot | |
python3 claude/script.py ${{secrets.ANTHROPIC_API_KEY}} | |
rm -rf diff.txt temp.txt | |
- name: Check if there are 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 Git | |
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: Update file with Docstring | |
if: steps.check.outputs.changes == 'true' | |
run: | | |
cd DocPilot | |
export GITHUB_TOKEN=$GITHUB_TOKEN | |
git add . | |
git commit -m "add docstring" | |
git push |