Code Build icon

Code Build

Build code using AI-powered development tools

Build

AI-generated

Overview

This node automates the process of building or modifying code in a GitHub repository using AI-powered development tools. It creates a new GitHub repository (if it doesn't exist), sets up a GitHub Actions workflow for AI code assistance, securely stores necessary API tokens as repository secrets, and opens an issue with instructions for the AI to execute. This node is useful for developers who want to leverage AI to automate code generation or enhancement tasks within their GitHub projects.

Use Case Examples

  1. Automatically create a new private GitHub repository and set up an AI assistant workflow to add a new feature based on a prompt.
  2. Modify an existing repository by instructing the AI to refactor or add functionality through GitHub issues and automated workflows.

Properties

Name Meaning
Owner The GitHub repository owner (username or organization). This identifies the account under which the repository is created or accessed.
Repository Name The name of the GitHub repository to create or modify.
Private Repository Boolean flag indicating whether the repository should be private.
Prompt Instructions for the AI to build or modify code in the repository. This is used to create an issue that triggers the AI workflow.

Output

JSON

  • success - Indicates if the build process was successful.
  • repository
    • owner - The owner of the GitHub repository.
    • name - The name of the GitHub repository.
    • fullName - The full name of the repository including owner and name.
    • url - The URL of the GitHub repository.
    • private - Indicates if the repository is private.
  • secret
    • name - The name of the secret created in the repository for API authentication.
    • created - Indicates if the secret was successfully created.
  • workflow
    • path - The file path of the GitHub Actions workflow added to the repository.
    • created - Indicates if the workflow file was successfully created.
    • url - The URL to view the workflow file in the repository.
  • issue
    • number - The issue number created to hold the AI build instructions.
    • title - The title of the created issue.
    • url - The URL of the created issue in GitHub.
  • prompt - The prompt text given to the AI for building or modifying code.

Dependencies

  • GitHub API for repository and workflow management
  • An API key credential for AI service authentication (e.g., Claude or Anthropics)

Troubleshooting

  • Error 422 when creating a repository indicates the repository already exists. Use a different repository name to resolve this.
  • Ensure the provided GitHub token has sufficient permissions to create repositories, manage secrets, and create issues.
  • Verify that the AI service API key or OAuth token is valid and correctly encrypted before storing as a secret.
  • Check that the GitHub Actions workflow YAML content is correctly formatted and committed to the repository.

Links

Discussion