Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

83 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AutoCoder – Automated Code Generation from GitHub Issues

AutoCoder is a GitHub Action that automatically generates code based on GitHub issue descriptions using OpenAI’s ChatGPT.
It then creates a pull request (PR) with the generated code, allowing your team to review and merge AI-assisted code contributions.


πŸš€ Features

  • Automatically triggers when an issue is labeled (configurable).
  • Uses OpenAI’s ChatGPT API to generate code from issue content.
  • Automatically commits generated code to a new branch.
  • Creates a Pull Request for review and merging.
  • Uploads generated code as an artifact for inspection.

🧩 How It Works

  1. A GitHub issue receives a specific label (e.g., autocoder).
  2. The workflow runs the AutoCoder composite action.
  3. The action:
    • Checks out the repository.
    • Generates code using a shell script that calls ChatGPT.
    • Commits the generated files.
    • Creates a new pull request linked to the issue.

βš™οΈ Inputs

Name Description Required Default
GITHUB_TOKEN GitHub token used to authenticate and create pull requests. βœ… Yes β€”
REPOSITORY The repository where the action runs (e.g., username/repo). βœ… Yes β€”
ISSUE_NUMBER The issue number that triggered the action. βœ… Yes β€”
OPENAI_API_KEY Your OpenAI API key to access ChatGPT. βœ… Yes β€”
SCRIPT_PATH Path to the script that handles ChatGPT code generation. ❌ No scripts/script.sh
LABEL Label used to trigger and tag PRs. ❌ No autocoder-bot

πŸ“€ Outputs

Name Description
pull_request_url The URL of the automatically created pull request containing the generated code.

🧠 Example Workflow

name: AutoCodeGen
on:
  issues:
    types: [labeled]

permissions:
  contents: write
  pull-requests: write

jobs:
  generate_code:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: AutoCoder Composite Action
        uses: jaunger-app/AutoCoder@v5
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          LABEL: 'autocoder'
          REPOSITORY: 'your-username/your-repo'
          ISSUE_NUMBER: ${{ github.event.issue.number }}
          SCRIPT_PATH: ./scripts/script.sh

About

AutoCoder is a GitHub Actions integration project designed to automate code generation and management tasks using ChatGPT. This repository contains configuration files and scripts to enable seamless interaction between GitHub workflows and AI-powered coding assistance, streamlining development, testing, and automation processes through intelligent

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages