GitHub Action
Use the official GitHub Action to integrate storybook-to-skills-md into your CI/CD pipeline.
Basic Usage
Section titled “Basic Usage”name: Generate SKILL.md Files
on: push: branches: [main] pull_request: branches: [main]
jobs: generate: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4
- name: Generate SKILL.md files uses: sergiocarracedo/storybook-to-skill-md-action@v1 with: storybook-url: 'https://your-storybook.com' source-dir: './src/components' output-dir: './skills' provider: 'openai' model: 'gpt-4o' env: API_KEY: ${{ secrets.OPENAI_API_KEY }}
- name: Commit and push if changed run: | git config --global user.name 'GitHub Action' git config --global user.email 'action@github.com' git add skills/ git diff --quiet && git diff --staged --quiet || \ (git commit -m "chore: update SKILL.md files [skip ci]" && git push)Action Inputs
Section titled “Action Inputs”| Input | Required | Description | Default |
|---|---|---|---|
storybook-url | No* | Storybook URL | - |
index-file | No* | Path to local index.json | - |
source-dir | No | Source directory | ./src |
output-dir | No | Output directory | ./skills |
provider | Yes | LLM provider: openai, anthropic, google | - |
model | Yes | Model name | - |
api-key | No | API key (use api-key input or API_KEY env var) | - |
concurrency | No | Concurrent requests | 3 |
include | No | Include patterns (comma-separated) | - |
exclude | No | Exclude patterns (comma-separated) | - |
verbose | No | Enable verbose logging | false |
*Either storybook-url or index-file is required.
Action Outputs
Section titled “Action Outputs”| Output | Description |
|---|---|
changed | Whether files were changed (true/false) |
count | Number of files generated |
Using Environment Variable for API Key
Section titled “Using Environment Variable for API Key”- name: Generate SKILL.md uses: sergiocarracedo/storybook-to-skill-md-action@v1 with: storybook-url: 'https://your-storybook.com' provider: 'openai' model: 'gpt-4o' env: API_KEY: ${{ secrets.OPENAI_API_KEY }}Store API Keys Securely
Section titled “Store API Keys Securely”- Go to your repository Settings → Secrets and variables → Actions
- Click New repository secret
- Add your API key:
- Name:
OPENAI_API_KEY(orANTHROPIC_API_KEY,GOOGLE_API_KEY) - Secret: Your actual API key
- Name:
Best Practices
Section titled “Best Practices”- Use
[skip ci]in commit messages — Prevent infinite loops - Cache dependencies — Speed up workflow with
actions/cache - Use
force: trueon releases — Ensure all files are regenerated - Monitor costs — Set
concurrencyto control API usage - Test in PRs — Generate in PRs but only commit on main branch
Troubleshooting
Section titled “Troubleshooting”Files not committing
Section titled “Files not committing”Make sure the workflow has write permissions:
permissions: contents: writeWorkflow timeout
Section titled “Workflow timeout”Increase timeout or reduce scope:
jobs: generate: timeout-minutes: 30 # Default is 360 (6 hours)