Documentation
CodeMaker AI
  • Quick start
    • Overview
    • Getting Started
      • Visual Studio Code
      • JetBrains
      • GitHub Action
      • CodeMaker CLI
  • Features
    • Coding Assistant
    • Interactive
      • Autocompletion
      • Inline code generation
      • Code Actions
      • Syntax Autocorrection
    • Batch
      • Code generation
      • Documentation generation
      • Predictive code generation
    • Source Context
    • Source Graph
  • Models
    • Fine-Tunning
  • Knowledge Base
    • Indexes
  • Source Code
    • Repositories
  • Integrations
    • IDE
      • Visual Studio Code
      • JetBrains
    • GitHub
      • GitHub Action
        • Continous Integration
        • Pull Requests
      • GitHub App
    • CLI
    • SDK
      • Go
      • JavaScript
Powered by GitBook
On this page
  • Overview
  • Example
  1. Integrations
  2. GitHub
  3. GitHub Action

Continous Integration

PreviousGitHub ActionNextPull Requests

Last updated 1 year ago

Overview

CodeMaker AI code generation features can be integrated directly into GitHub Action workflow. can be executed on the checkout source code and will only make changes to the working directory tree, because of that either a commit or pull request needs to be created as a separate step.

The action defines the following properties:

  • api-key - unique API Key needed to invoke the service. Should be stored as a secret.

  • mode - the code generation mode. Supported modes are code, docs.

  • path - the path to a directory or file to process. Supports glob wildcard patterns, for instance, path **/*.js will match the JavaScript file in any subdirectory of the working directory.

The GitHub Action can be easily integrated with automated workflow that can be triggered on pull request push or commit to any of the branches. Alternatively, it can be triggered manually on demand.

Example

Create a new GitHub workflow under ./github/workflows named codemaker.yml with the following content.

on: [push]

jobs:
  codemakerai_code_generation:
    runs-on: ubuntu-latest
    name: A job to run codemakerai code generation
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Code generation
        uses: codemakerai/codemaker-action@v1.5.0
        with:
          api-key: ${{ secrets.CODEMAKER_API_KEY }}
          mode: code
          path: src/**/*.java
      - name: Create Pull Request
        uses: peter-evans/create-pull-request@v6
        with:
          commit-message: Code generated by codemaker
          title: Changes by codemaker-action
          body: This pull request contains code generated by codemaker.
          branch: codemakerai-generate

The above configuration defines the workflow that is going to be triggered on git push. The workflow checkouts the latest revision of the source code and executes code generation tasks on any Java file located anywhere in the directory tree under the src directory.

CodeMaker Action