StructKit can seamlessly integrate with GitHub to automate the generation of project structures across repositories.
Combine GitHub Actions with StructKit to automate project structure generation in CI/CD pipelines. Trigger the process manually or automatically based on events like pull requests or pushes.
Example Workflow:
name: run-struct
on:
workflow_dispatch:
jobs:
generate:
uses: httpdss/structkit/.github/workflows/struct-generate.yaml@main
secrets:
token: ${{ secrets.STRUCT_RUN_TOKEN }}When struct_file is omitted, the workflow uses .structkit.yaml if present and falls back to a legacy .struct.yaml.
httpdss/structkit-setup installs StructKit onto PATH. Use it when you want to run arbitrary structkit commands in a job (list, validate, generate, or anything else the CLI supports):
- uses: actions/checkout@v7
- uses: httpdss/structkit-setup@v0
- run: structkit list
- run: structkit validate .structkit.yamlOptional: pin the StructKit version on setup:
- uses: httpdss/structkit-setup@v0
with:
structkit-version: "3.3.0"For validate, generate, or a dry-run diff/drift check as a step in your own job (instead of calling the reusable workflow as a complete job), use httpdss/structkit-action.
The actions are separate: structkit-action does not install StructKit or call setup internally. Use setup first, then the action:
- uses: actions/checkout@v7
- uses: httpdss/structkit-setup@v0
- uses: httpdss/structkit-action@v0
with:
command: validate
struct_file: .structkit.yamlDrift check (generate + --dry-run --diff):
- uses: actions/checkout@v7
- uses: httpdss/structkit-setup@v0
- uses: httpdss/structkit-action@v0
with:
command: generate
struct_file: .structkit.yaml
dry_run: true
diff: true
fail_on_diff: trueGenerate:
- uses: actions/checkout@v7
- uses: httpdss/structkit-setup@v0
- uses: httpdss/structkit-action@v0
with:
command: generate
struct_file: .structkit.yaml
output_dir: .The reusable workflow above is a full job with built-in PR creation. The action is a step you can mix with other checkout, test, or commit steps. See the setup README and the action README for full workflow examples and inputs.
- Secure Your Token: Store GitHub tokens in secrets management tools.
- Use Topics for Filtering: Organize repositories with topics to efficiently manage workflows.
- Test Locally First: Simulate script actions with
--dry-runbefore executing in a CI/CD environment. - Combine with Other Tools: Use StructKit with Terraform, Ansible, or Docker for comprehensive project management.
Using GitHub integration allows you to leverage StructKit's automation capabilities in a version-controlled environment, enabling consistent and repeatable project structures.
Yes, you can tailor the GitHub Action to your specific needs, including custom triggers, different environments, and additional dependencies.