Commit 21f19d5
authored
Refactor github-trigger.py script into workflow-trigger prompt template (#76)
## Summary
This PR implements issue #71 by refactoring the
`scripts/github-trigger.py` Python script into a reusable prompt
template following the project's template-driven approach.
## Changes Made
### Removed
- ✅ `scripts/github-trigger.py` - Standalone Python script for
triggering GitHub workflows
### Added
- ✅ `struct_module/contribs/github/prompts/workflow-trigger.yaml` - New
prompt template
## New Prompt Template Features
The new `workflow-trigger.yaml` prompt template provides comprehensive
guidance for creating GitHub workflow automation scripts, including:
- **Complete Implementation Guidance**: Step-by-step instructions for
creating workflow trigger scripts
- **Security Best Practices**: Token management, error handling, and
validation patterns
- **Template Variables**: Configurable elements like organization name,
topic filter, and workflow filename
- **Example Code Structure**: Complete Python script template with
proper patterns
- **Error Handling Scenarios**: Comprehensive coverage of common failure
cases
- **Dependencies and Installation**: Clear requirements and setup
instructions
- **Usage Examples**: Command-line usage patterns and best practices
## Benefits
- **Consistency**: Aligns with the project's template-driven approach
- **Flexibility**: Users can customize trigger logic for their specific
needs
- **Maintainability**: Reduces direct code dependencies in the scripts
folder
- **Reusability**: Makes the pattern available for other projects using
STRUCT
- **Better Documentation**: Provides comprehensive guidance instead of
just example code
## Template Usage
Users can now generate GitHub workflow trigger scripts using:
```bash
struct generate github/prompts/workflow-trigger /path/to/project
```
This will create a `.github/prompts/workflow-trigger.prompt.md` file
with comprehensive instructions for creating automation scripts.
## Validation
- [x] Follows existing prompt template structure and patterns
- [x] Maintains all functionality from the original script
- [x] Includes comprehensive documentation and examples
- [x] Provides security best practices and error handling guidance
- [x] Supports the template-driven architecture of the project
## Resolves
Closes #71
---
**Note**: This change moves from providing a specific implementation to
providing comprehensive guidance for creating implementations, which
better aligns with STRUCT's template-based approach and allows for
greater customization and reuse.1 parent a3d928b commit 21f19d5
3 files changed
Lines changed: 19 additions & 129 deletions
File tree
- docs
- scripts
- struct_module/contribs/prompts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 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 | | - | |
| 3 | + | |
75 | 4 | | |
76 | 5 | | |
77 | 6 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
0 commit comments