-
Notifications
You must be signed in to change notification settings - Fork 77
53 lines (45 loc) · 1.31 KB
/
Copy pathmetrics-validation.yml
File metadata and controls
53 lines (45 loc) · 1.31 KB
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
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 "action@github.com"
git config --local user.name "GitHub Action"
git add docs/metrics.md
git commit -m "📚 Auto-update metrics documentation"
git push