feat(ci): add AI coding automation workflows with GitHub integration#1
feat(ci): add AI coding automation workflows with GitHub integration#1kla-bemindlabs wants to merge 1 commit into
Conversation
Add comprehensive AI-powered automation workflows: - ai-issue-handler: Auto-triage, label, and respond to issues with AI commands - ai-pr-review: Automated code review with coverage and security analysis - ai-project-sync: Bidirectional sync between local backlog and GitHub Projects - ai-docs-sync: Auto-generate wiki, API docs, and changelog Include sprint planning document and updated backlog with AI automation epic (46 story points). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| id: fix | ||
| run: | | ||
| echo "AI analysis would happen here" | ||
| echo "Issue: ${{ github.event.issue.title }}" |
Check failure
Code scanning / CodeQL
Code injection Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
In general, to fix this problem in GitHub Actions you must avoid inserting untrusted expressions directly into the script text passed to run:. Instead, assign untrusted values to environment variables via ${{ ... }} and then reference them using the shell’s native variable syntax ($VAR), or via process.env / the appropriate API inside another language. This prevents the untrusted content from being parsed as part of the shell script itself.
For this specific workflow, the problematic usage is in the Analyze and create fix step (lines 161–172). The step currently does:
run: |
echo "AI analysis would happen here"
echo "Issue: ${{ github.event.issue.title }}"
echo "Body: ${{ github.event.issue.body }}"We should move github.event.issue.title and github.event.issue.body into environment variables using the expression syntax, then reference them in the shell with $ISSUE_TITLE and $ISSUE_BODY. For example:
- name: Analyze and create fix
id: fix
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_BODY: ${{ github.event.issue.body }}
run: |
echo "AI analysis would happen here"
echo "Issue: $ISSUE_TITLE"
echo "Body: $ISSUE_BODY"
echo "fix_applied=false" >> $GITHUB_OUTPUTThis preserves existing functionality (printing the same values) while eliminating the code-injection vector flagged by CodeQL. No new imports or external dependencies are required; the change is limited to editing the Analyze and create fix step in .github/workflows/ai-issue-handler.yml.
| @@ -160,10 +160,13 @@ | ||
| # In production, this would invoke Claude Code or similar | ||
| - name: Analyze and create fix | ||
| id: fix | ||
| env: | ||
| ISSUE_TITLE: ${{ github.event.issue.title }} | ||
| ISSUE_BODY: ${{ github.event.issue.body }} | ||
| run: | | ||
| echo "AI analysis would happen here" | ||
| echo "Issue: ${{ github.event.issue.title }}" | ||
| echo "Body: ${{ github.event.issue.body }}" | ||
| echo "Issue: $ISSUE_TITLE" | ||
| echo "Body: $ISSUE_BODY" | ||
| # Placeholder - actual implementation would: | ||
| # 1. Parse issue for error details | ||
| # 2. Search codebase for related files |
| run: | | ||
| echo "AI analysis would happen here" | ||
| echo "Issue: ${{ github.event.issue.title }}" | ||
| echo "Body: ${{ github.event.issue.body }}" |
Check failure
Code scanning / CodeQL
Code injection Critical
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 months ago
In general, to fix this class of issue in GitHub Actions, you must not embed user-controlled expressions directly into run: or script: blocks. Instead, assign the expression to an environment variable using workflow expression syntax, and then read that variable using the native syntax of the shell (e.g., $BODY in bash) or from process.env in JavaScript. This prevents user data from being interpreted as part of the script itself.
For this specific workflow, the problematic use is in the Analyze and create fix step, where the untrusted issue body is interpolated inline:
- name: Analyze and create fix
id: fix
run: |
echo "AI analysis would happen here"
echo "Issue: ${{ github.event.issue.title }}"
echo "Body: ${{ github.event.issue.body }}"We should add an env: section to that step to pass both the issue title and body as environment variables, and then update the shell script to echo $ISSUE_TITLE and $ISSUE_BODY using bash syntax. This removes all ${{ ... }} expansions from the shell code while preserving current behavior (still only echoing the values). Concretely, edit .github/workflows/ai-issue-handler.yml around lines 161–166 to:
- Add:
env: ISSUE_TITLE: ${{ github.event.issue.title }} ISSUE_BODY: ${{ github.event.issue.body }}
- Change:
to:
echo "Issue: ${{ github.event.issue.title }}" echo "Body: ${{ github.event.issue.body }}"
echo "Issue: $ISSUE_TITLE" echo "Body: $ISSUE_BODY"
No new imports or external libraries are needed; this is purely a YAML/workflow change. All other steps remain unchanged, and functionality is preserved.
| @@ -160,10 +160,13 @@ | ||
| # In production, this would invoke Claude Code or similar | ||
| - name: Analyze and create fix | ||
| id: fix | ||
| env: | ||
| ISSUE_TITLE: ${{ github.event.issue.title }} | ||
| ISSUE_BODY: ${{ github.event.issue.body }} | ||
| run: | | ||
| echo "AI analysis would happen here" | ||
| echo "Issue: ${{ github.event.issue.title }}" | ||
| echo "Body: ${{ github.event.issue.body }}" | ||
| echo "Issue: $ISSUE_TITLE" | ||
| echo "Body: $ISSUE_BODY" | ||
| # Placeholder - actual implementation would: | ||
| # 1. Parse issue for error details | ||
| # 2. Search codebase for related files |
Summary
Changes
New Workflows
ai-issue-handler.yml/ai-*commandsai-pr-review.ymlai-project-sync.ymlai-docs-sync.ymlSprint Planning
.scrum/planning/sprint-1-ai-automation-planning.mdTest plan
🤖 Generated with Claude Code