Skip to content

Conversation

@kenrogers
Copy link
Contributor

Problem

The Smart Docs Monitor workflow was unable to create issues because Claude Code Action runs in restricted mode where gh issue create commands require approval, but there's no approval mechanism in automated workflows.

From the logs:

🔧 Bash
Parameters: { "command": "gh issue create --repo stacks-network/docs ..." }
❌ Error: This command requires approval

Solution

This PR separates concerns:

  • Claude analyzes PRs and outputs structured JSON
  • GitHub Actions creates issues from the JSON using the GitHub API

Changes:

  1. Renamed step: "Analyze with Claude and create issues" → "Analyze PRs with Claude"

  2. Updated Claude prompt:

    • Removed instructions to create issues directly
    • Added instructions to output JSON array to issues-to-create.json
    • JSON format includes title, body, and labels for each issue
  3. Added new step: "Create issues from Claude analysis"

    • Uses actions/github-script@v7
    • Reads issues-to-create.json
    • Creates issues via GitHub REST API
    • No approval needed - native API access

Benefits:

  • ✅ Issues are actually created (no approval blockers)
  • ✅ Better separation of concerns (analysis vs API calls)
  • ✅ Easier to debug (JSON is visible in logs)
  • ✅ More reliable (native GitHub API vs CLI)

Testing

After merge, trigger manually to test:

gh workflow run smart-docs-monitor.yml -f hours_back=24

Expected: Claude analyzes PRs, outputs JSON, and issues are created automatically.


🤖 Generated with Claude Code

Changes Claude's role from trying to create issues directly (which requires approval) to outputting structured JSON. A new github-script step then creates the issues using the GitHub API without approval requirements.

Changes:
- Claude now analyzes PRs and outputs JSON to issues-to-create.json
- New step uses actions/github-script@v7 to create issues from JSON
- Cleaner separation: Claude does analysis, GitHub Actions handles API calls
- No more approval blockers for issue creation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@kenrogers kenrogers requested a review from a team as a code owner October 2, 2025 17:52
@CLAassistant
Copy link

CLAassistant commented Oct 2, 2025

CLA assistant check
All committers have signed the CLA.

@kenrogers kenrogers merged commit ccca1c5 into stacks-network:master Oct 2, 2025
5 of 6 checks passed
@kenrogers kenrogers deleted the fix-issue-creation-workflow branch October 2, 2025 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants