Skip to content

ci: add action to update the api references. #1214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/update_api_references.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Update API references
on:
pull_request_review:
types: [submitted]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update_api_references:
if: github.event.pull_request.base.ref == 'master' && github.event.review.state == 'approved'
name: Update API References
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: install_tool_and_generate_api_docs
run: |
dotnet tool install -g XMLDoc2Markdown
dotnet build ./LLama/LLamaSharp.csproj
cd LLama/bin/Debug/net8.0
rm -rf ../../../../docs/xmldocs
dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button

- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "[email protected]"
git add docs/xmldocs
if git diff --cached --quiet; then
echo "No changes to commit."
exit 0
fi
echo "Current git status:"
git status
echo "Modified files:"
git diff --cached --name-only
git commit -m "chore(docs): update API references in the github action."
git push
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}

Loading