Skip to content

Refactor github-trigger.py script into a GitHub workflow prompt template #71

@httpdss

Description

@httpdss

Summary

Move the functionality of scripts/github-trigger.py from a standalone Python script to a prompt-based template in the struct_module/contribs/github/prompts/ folder, following the existing pattern used by other prompt templates.

Current State

The scripts/github-trigger.py file contains a Python script that:

  • Fetches repositories in a GitHub organization with a specific topic
  • Triggers the 'run-struct.yaml' workflow for each matching repository
  • Uses PyGithub library for GitHub API interactions
  • Requires GITHUB_TOKEN environment variable

Proposed Changes

  1. Remove scripts/github-trigger.py
  2. Create a new prompt template at struct_module/contribs/github/prompts/workflow-trigger.yaml
  3. The new prompt should guide users to create GitHub workflow automation scripts

Expected Structure

The new prompt template should follow the pattern of existing prompts and include:

  • Instructions for creating GitHub workflow trigger scripts
  • Best practices for GitHub API usage
  • Template variables for organization name, topic, and workflow filename
  • Security considerations (token handling, permissions)
  • Example implementation guidance

Benefits

  • Consistency: Aligns with the project's template-driven approach
  • Flexibility: Users can customize the 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

Files to be affected

  • Removed: scripts/github-trigger.py
  • Added: struct_module/contribs/github/prompts/workflow-trigger.yaml

Acceptance Criteria

  • scripts/github-trigger.py is removed
  • New prompt template is created in the correct location
  • Prompt template includes comprehensive guidance for GitHub workflow automation
  • Template follows the same structure as existing prompt files
  • Documentation is updated if necessary

Related

This change supports the overall goal of making STRUCT more template-driven and reduces the maintenance burden of custom scripts while providing users with flexible, reusable patterns.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions