66 pull_request :
77 branches : [ main, master ]
88 workflow_dispatch : # Allow manual triggering
9+ repository_dispatch : # Allow external triggers
10+ types : [update-llms]
911
1012permissions :
1113 contents : write
@@ -23,18 +25,31 @@ jobs:
2325 uses : actions/setup-python@v4
2426 with :
2527 python-version : ' 3.12'
28+ cache : ' pip'
2629
2730 - name : Install uv
2831 run : |
2932 curl -LsSf https://astral.sh/uv/install.sh | sh
3033 echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3134
32- - name : Install dependencies
35+ - name : Create venv and install dependencies
3336 run : |
34- uv pip install .
37+ uv venv
38+ . .venv/bin/activate
39+ uv pip install git+https://github.com/ngmisl/llmstxt.git
3540
36- - name : Generate llms.txt
37- run : python llms.py
41+ - name : Clone target repository
42+ if : github.event_name == 'repository_dispatch'
43+ run : |
44+ git clone ${{ github.event.client_payload.repository }} target_repo
45+ cd target_repo
46+ python -m llmstxt
47+
48+ - name : Generate llms.txt for current repository
49+ if : github.event_name != 'repository_dispatch'
50+ run : |
51+ . .venv/bin/activate
52+ python -m llmstxt
3853
3954 - name : Check for changes
4055 id : changes
@@ -47,11 +62,15 @@ jobs:
4762 echo "changes=true" >> $GITHUB_OUTPUT
4863 fi
4964
50- - name : Commit and push if changed
65+ - name : Create Pull Request
5166 if : steps.changes.outputs.changes == 'true'
52- run : |
53- git config --local user.email "github-actions[bot]@users.noreply.github.com"
54- git config --local user.name "github-actions[bot]"
55- git add llms.txt
56- git commit -m "chore: update llms.txt [skip ci]"
57- git push
67+ uses : peter-evans/create-pull-request@v5
68+ with :
69+ commit-message : " chore: update llms.txt"
70+ title : " chore: update llms.txt"
71+ body : |
72+ This PR updates the llms.txt file with the latest code compression.
73+
74+ Changes were automatically generated by [llmstxt](https://github.com/ngmisl/llmstxt).
75+ branch : update-llms
76+ delete-branch : true
0 commit comments