Skip to content

Commit d237de2

Browse files
authored
feat: Improve GitHub workflow automation for schema and SDK docs (#1615)
1 parent e6eb6ae commit d237de2

File tree

2 files changed

+15
-36
lines changed

2 files changed

+15
-36
lines changed

.github/workflows/update-config-schema.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,29 @@ jobs:
4242
- name: Generate config schema
4343
run: |
4444
echo "🔄 Generating fastmcp.json schema..."
45+
46+
# Generate schema in docs/public for web access
4547
uv run python -c "
4648
from fastmcp.utilities.fastmcp_config import generate_schema
4749
generate_schema('docs/public/schemas/fastmcp.json/latest.json')
48-
print('✅ Schema generated successfully')
50+
print('✅ Latest schema generated in docs/public')
4951
"
5052
51-
# Also update the v1 schema for consistency
53+
# Also update the v1 schema in docs/public
5254
uv run python -c "
5355
from fastmcp.utilities.fastmcp_config import generate_schema
5456
generate_schema('docs/public/schemas/fastmcp.json/v1.json')
55-
print('✅ v1 schema updated')
57+
print('✅ v1 schema generated in docs/public')
5658
"
5759
58-
- name: Check for changes
59-
id: check_changes
60-
run: |
61-
if git diff --quiet docs/public/schemas/fastmcp.json/; then
62-
echo "No changes detected in config schema"
63-
echo "has_changes=false" >> $GITHUB_OUTPUT
64-
else
65-
echo "Changes detected in config schema"
66-
echo "has_changes=true" >> $GITHUB_OUTPUT
67-
fi
60+
# Generate schema in the source directory for local development
61+
uv run python -c "
62+
from fastmcp.utilities.fastmcp_config import generate_schema
63+
generate_schema('src/fastmcp/utilities/fastmcp_config/v1/schema.json')
64+
print('✅ Schema generated in utilities/fastmcp_config/v1/')
65+
"
6866
6967
- name: Create Pull Request
70-
if: steps.check_changes.outputs.has_changes == 'true'
7168
uses: peter-evans/create-pull-request@v7
7269
with:
7370
token: ${{ steps.marvin-token.outputs.token }}
@@ -86,8 +83,5 @@ jobs:
8683

8784
- name: Summary
8885
run: |
89-
if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
90-
echo "✅ Config schema PR created"
91-
else
92-
echo "✅ Config schema is already up to date"
93-
fi
86+
echo "✅ Config schema generation workflow completed"
87+
echo "PR will be created if there are changes, or closed if schema is already up to date"

.github/workflows/update-sdk-docs.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,7 @@ jobs:
4747
echo "🔄 Generating SDK documentation..."
4848
just api-ref-all
4949
50-
- name: Check for changes
51-
id: check_changes
52-
run: |
53-
if git diff --quiet docs/python-sdk/ docs/docs.json; then
54-
echo "No changes detected in SDK documentation"
55-
echo "has_changes=false" >> $GITHUB_OUTPUT
56-
else
57-
echo "Changes detected in SDK documentation"
58-
echo "has_changes=true" >> $GITHUB_OUTPUT
59-
fi
60-
6150
- name: Create Pull Request
62-
if: steps.check_changes.outputs.has_changes == 'true'
6351
uses: peter-evans/create-pull-request@v7
6452
with:
6553
token: ${{ steps.marvin-token.outputs.token }}
@@ -78,8 +66,5 @@ jobs:
7866

7967
- name: Summary
8068
run: |
81-
if [ "${{ steps.check_changes.outputs.has_changes }}" == "true" ]; then
82-
echo "✅ SDK documentation PR created"
83-
else
84-
echo "✅ SDK documentation is already up to date"
85-
fi
69+
echo "✅ SDK documentation generation workflow completed"
70+
echo "PR will be created if there are changes, or closed if documentation is already up to date"

0 commit comments

Comments
 (0)