-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (46 loc) · 2.1 KB
/
update-docs-webhook.yml
File metadata and controls
55 lines (46 loc) · 2.1 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
54
55
name: Update Documentation Examples
on:
push:
branches: [main]
workflow_dispatch: # Allow manual trigger
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Generate examples metadata
run: |
echo "Generating examples metadata..."
python .github/scripts/generate_examples_metadata.py
# Check if the file was generated
if [ ! -f examples-metadata.json ]; then
echo "Error: examples-metadata.json was not generated"
exit 1
fi
echo "Generated metadata:"
cat examples-metadata.json | jq '.examples | length' | xargs -I {} echo " - {} examples found"
cat examples-metadata.json | jq '.features_list | length' | xargs -I {} echo " - {} unique features"
cat examples-metadata.json | jq '.languages_list | length' | xargs -I {} echo " - {} programming languages"
- name: Upload examples metadata as artifact
uses: actions/upload-artifact@v4
with:
name: examples-metadata
path: examples-metadata.json
- name: Summary
run: |
echo "## Examples Metadata Update" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Successfully updated documentation examples" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Statistics" >> $GITHUB_STEP_SUMMARY
echo "- Examples: $(cat examples-metadata.json | jq '.examples | length')" >> $GITHUB_STEP_SUMMARY
echo "- Features: $(cat examples-metadata.json | jq '.features_list | length')" >> $GITHUB_STEP_SUMMARY
echo "- Languages: $(cat examples-metadata.json | jq '.languages_list | length')" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Languages" >> $GITHUB_STEP_SUMMARY
cat examples-metadata.json | jq -r '.languages_list | join(", ")' >> $GITHUB_STEP_SUMMARY