-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcodeglide-mcpgen-CI-workflow.yml
More file actions
77 lines (70 loc) · 2.63 KB
/
codeglide-mcpgen-CI-workflow.yml
File metadata and controls
77 lines (70 loc) · 2.63 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: codeglide MCP gen commit/PR
on:
# Trigger on any push - let the script decide if it's API-related
push:
# Keep manual trigger option for custom configurations
workflow_dispatch:
inputs:
input_directory:
description: 'Directory containing API source code (relative to workspace)'
type: string
required: false
default: '.'
custom_headers:
description: 'Custom headers in API requests - {"key":"value"}'
type: string
required: false
default: '{}'
create_pr:
description: 'Create PR with generated code'
type: boolean
required: false
default: true
create_branch_and_commit:
description: 'Create branch and commit with generated code'
type: boolean
required: false
default: false
check_api_changes:
description: 'Enable API change detection'
type: boolean
required: false
default: true
# Add permissions
permissions:
contents: write
pull-requests: write
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # Fetch last 2 commits to compare changes
- name: Get changed files
id: changed-files
run: |
# Get the list of changed files between previous and current commit
if [[ "${{ github.event_name }}" == "push" ]]; then
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGED_FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "Files changed:"
echo "$CHANGED_FILES"
else
# For manual triggers, check all files
echo "changed_files<<EOF" >> $GITHUB_OUTPUT
echo "ALL_FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "Manual trigger - checking all files"
fi
- name: codeglide MCP generator
uses: CodeGlide/codeglide-mcpgen@v1.0.10
with:
input_directory: ${{ inputs.input_directory || '.' }}
custom_headers: ${{ inputs.custom_headers || '{}' }}
create_pr: ${{ github.event_name == 'push' && 'true' || (inputs.create_pr == true && 'true' || 'false') }} # Auto-create PR on push, or when manually enabled
create_branch_and_commit: ${{ github.event_name == 'push' && 'true' || (inputs.create_branch_and_commit == true && 'true' || 'false') }}
check_api_changes: ${{ inputs.check_api_changes || 'true' }} # Enable API change detection by default
changed_files: ${{ steps.changed-files.outputs.changed_files }}