This file contains hidden or 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: Metrics Documentation Auto-Update | |
| on: | |
| push: | |
| branches: [ main, dev ] | |
| paths: | |
| - 'dingo/model/prompt/**' | |
| - 'scripts/generate_metrics.py' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'dingo/model/prompt/**' | |
| - 'scripts/generate_metrics.py' | |
| workflow_dispatch: | |
| jobs: | |
| update-metrics-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Generate metrics documentation | |
| run: | | |
| python scripts/generate_metrics.py | |
| - name: Check if documentation changed | |
| id: check_changes | |
| run: | | |
| if git diff --quiet docs/metrics.md; then | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit updated documentation | |
| if: steps.check_changes.outputs.changed == 'true' && github.event_name == 'push' | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add docs/metrics.md | |
| git commit -m "📚 Auto-update metrics documentation" | |
| git push |