The Workload-Variant-Autoscaler repository uses GitHub Agentic Workflows (gh-aw) to automate documentation updates, workflow creation, and debugging tasks. These AI-powered workflows help maintain consistency and reduce manual maintenance overhead.
Agentic workflows are AI-powered GitHub Actions that use natural language instructions to automate repository tasks. They combine GitHub Actions' automation capabilities with AI agents that can read, write, and interact with your repository.
Trigger: Automatic on every push to main branch
Purpose: Keeps documentation synchronized with code changes
This workflow:
- Analyzes code changes in each commit
- Identifies documentation gaps or outdated content
- Creates draft pull requests with documentation updates
- Follows Diátaxis framework (tutorials, how-to guides, reference, explanation)
- Maintains consistent style (precise, concise, developer-friendly)
Workflow file: .github/workflows/update-docs.md
Trigger: Automatic when a PR is opened by github-actions[bot] with title starting with docs:
Purpose: Assigns documentation PRs to the author of the original PR that triggered the docs update
This workflow:
- Detects documentation PRs created by the Update Docs workflow
- Extracts the original PR number from the docs PR body or branch name
- Assigns the docs PR to the original PR author (not the merger)
- Adds a comment with attribution for transparency
- Falls back to the most recently merged PR if metadata lookup fails
Workflow file: .github/workflows/assign-docs-pr.yml
This ensures accountability and visibility for documentation changes, making it clear who should review and merge the docs update.
Trigger: Manual via custom agent
Purpose: Interactive workflow designer to create new agentic workflows
This agent helps you:
- Define workflow triggers (issues, PRs, schedules, slash commands)
- Select appropriate tools and MCP servers
- Configure security and network access
- Generate workflow markdown files
Agent file: .github/agents/create-agentic-workflow.agent.md
Trigger: Manual via custom agent
Purpose: Debug and refine existing workflows
Use this agent to:
- Analyze workflow logs
- Audit workflow runs
- Improve workflow performance
- Troubleshoot failures
Agent file: .github/agents/debug-agentic-workflow.agent.md
The gh-aw CLI extension is required to work with agentic workflows:
# Install gh-aw extension
curl -fsSL https://raw.githubusercontent.com/githubnext/gh-aw/refs/heads/main/install-gh-aw.sh | bash
# Verify installation
gh aw versionAgentic workflows use markdown files with YAML frontmatter:
---
on:
push:
branches: [main]
permissions:
contents: read
pull-requests: write
tools:
github:
toolsets: [all]
bash: [":*"]
timeout-minutes: 15
---
# Workflow Title
Natural language instructions for what the AI should do.
Use GitHub context like ${{ github.repository }}.# Compile all workflows in .github/workflows/
gh aw compile
# Compile a specific workflow
gh aw compile update-docs
# Compile with strict security validation
gh aw compile --strict
# Remove orphaned lock files
gh aw compile --purgeCompilation process:
.github/workflows/example.md→.github/workflows/example.lock.yml- Dependencies are resolved and merged
- Tool configurations are processed
- GitHub Actions syntax is generated
-
Create workflow markdown file:
# Create in .github/workflows/ touch .github/workflows/my-workflow.md -
Define frontmatter and instructions:
--- on: issues: types: [opened] permissions: issues: write tools: github: allowed: - add_issue_comment --- # My Workflow When an issue is opened, analyze it and add a helpful comment.
-
Compile the workflow:
gh aw compile my-workflow
-
Commit both files:
git add .github/workflows/my-workflow.md git add .github/workflows/my-workflow.lock.yml git commit -m "feat: add my-workflow agentic workflow"
- Edit the markdown file (
.md), not the lock file (.lock.yml) - Recompile after changes:
gh aw compile workflow-name
- Commit both files (the
.mdsource and updated.lock.yml)
Never edit .lock.yml files directly - they are generated and will be overwritten.
Common trigger patterns:
# Push to branches
on:
push:
branches: [main, develop]
# Pull requests
on:
pull_request:
types: [opened, synchronize]
# Issues
on:
issues:
types: [opened, labeled]
# Scheduled
on:
schedule:
- cron: "0 14 * * 1-5" # 2 PM UTC, weekdays only
# Manual dispatch
on:
workflow_dispatch:
# Slash commands (mentions)
on:
command: "/my-command"Grant minimal required permissions:
permissions:
contents: read # Read repository content
issues: write # Create/update issues
pull-requests: write # Create/update PRs
discussions: write # Create/update discussionsAvailable tool categories:
tools:
# GitHub API access
github:
toolsets: [all] # or specify allowed operations
allowed:
- create_issue
- add_issue_comment
# File operations
edit: # Edit files
view: # View files
# Web access
web-fetch: # Fetch web content
web-search: # Search the web
# Shell commands (whitelist patterns)
bash:
- "git status"
- "make:*"
- "gh label:*"
# Browser automation
playwright:Control network access for security:
# Default: localhost only
network: defaults
# Allow specific ecosystems
network:
- node # npm registry
- python # PyPI
- go # Go modules
# Allow specific domains
network:
- "api.example.com"
- "*.github.com"- Minimal Permissions: Grant only required permissions
- Tool Whitelisting: Use fine-grained tool access controls
- Network Restrictions: Limit network access to necessary domains
- Fork Protection: Configure fork allowlists for
pull_requesttriggers - Strict Compilation: Use
gh aw compile --strictto validate security
By default, workflows block all forks and only allow same-repo PRs:
on:
pull_request:
forks: ["*"] # Allow all forks
# or
forks: ["llm-d/*"] # Allow organization forks onlyRequire manual approval for sensitive operations:
on:
issues:
types: [labeled]
manual-approval: true # Requires environment protection rules
environment: production # Must have protection rules configured# List recent runs
gh run list --workflow=update-docs.lock.yml
# View specific run
gh run view <run-id>
# View logs
gh run view <run-id> --logWorkflow not triggering:
- Verify
.lock.ymlfile exists - Check trigger conditions match event
- Ensure permissions are granted
Compilation fails:
- Run
gh aw compile --strictfor detailed errors - Check YAML frontmatter syntax
- Verify tool configurations are valid
Workflow fails during execution:
- Check workflow run logs in GitHub Actions
- Verify required tools are available
- Check network/permission restrictions
Model Context Protocol (MCP) servers provide reusable capabilities:
mcp-servers:
my-custom-server:
command: "node"
args: ["path/to/mcp-server.js"]
env:
API_KEY: ${{ secrets.API_KEY }}Inspect available MCP servers:
# List all MCP servers
gh aw mcp inspect
# Inspect specific server
gh aw mcp inspect --server my-custom-server
# List tools provided by server
gh aw mcp inspect --server my-custom-server --toolWorkflows can expire after a specified time:
on:
push:
branches: [main]
stop-after: +1mo # Expires after 1 monthSupported time units: h (hours), d (days), mo (months)
Add emoji reactions to triggering items:
on:
issues:
types: [opened]
reaction: "👀" # Adds eyes emoji to new issuesCustomize workflow run names:
run-name: "Update docs for ${{ github.event.head_commit.message }}"Control how workflows create GitHub resources:
safe-outputs:
create-pull-request:
draft: true # Always create draft PRs
create-issue:
labels: ["automated"]
create-discussion:
category: "Announcements"Run security scanners on workflows:
# Run actionlint (includes shellcheck)
gh aw compile --actionlint
# Run Zizmor security scanner
gh aw compile --zizmor
# Run Poutine supply chain analyzer
gh aw compile --poutine
# Run all scanners with strict mode
gh aw compile --strict --actionlint --zizmor --poutine- Official Documentation: gh-aw GitHub Repository
- Schema Reference:
.github/aw/github-agentic-workflows.md - Agent Templates:
.github/agents/ - Example Workflows:
.github/workflows/*.md
- Review the gh-aw documentation
- Check
.github/aw/github-agentic-workflows.mdfor schema details - Use the
create-agentic-workflowagent for interactive guidance - Open issues in the gh-aw repository
- Keep workflows focused: Each workflow should have a single, clear purpose
- Use descriptive names: Workflow files and titles should clearly indicate their function
- Test locally: Use
gh aw compile --strictbefore committing - Document workflows: Add clear natural language instructions
- Version control: Always commit both
.mdand.lock.ymlfiles - Security first: Use minimal permissions and tool access
- Regular maintenance: Review and update workflows as repository needs change
- Monitor runs: Check workflow execution logs regularly for issues
Note: The gh-aw extension was upgraded from v0.31.10 to v0.33.12 on December 22, 2025, to fix npm permissions issues in the sandbox container.