Skip to content

pelikhan/action-genai-pull-request-descriptor

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Pull Request Descriptor

Generate a pull request description based on the changes in the codebase

Inputs

  • base: The base branch of the pull request
  • gitmojis: Whether to use gitmojis in the pull request description (default: true)
  • instructions: Instructions for the code reviewer
  • excluded: Excluded paths from diff
  • debug: Enable debug logging (https://microsoft.github.io/genaiscript/reference/scripts/logging/).
  • github_issue: GitHub pull request number to use when generating comments (https://microsoft.github.io/genaiscript/reference/scripts/github/) (${{ github.event.pull_request.number }})
  • openai_api_key: OpenAI API key, ${{ secrets.OPENAI_API_KEY }}
  • openai_api_base: OpenAI API base URL, ${{ env.OPENAI_API_BASE }}
  • azure_openai_api_endpoint: Azure OpenAI endpoint. In the Azure Portal, open your Azure OpenAI resource, Keys and Endpoints, copy Endpoint., ${{ env.AZURE_OPENAI_API_ENDPOINT }}
  • azure_openai_api_key: Azure OpenAI API key. **You do NOT need this if you are using Microsoft Entra ID., ${{ secrets.AZURE_OPENAI_API_KEY }}
  • azure_openai_subscription_id: Azure OpenAI subscription ID to list available deployments (Microsoft Entra only)., ${{ env.AZURE_OPENAI_SUBSCRIPTION_ID }}
  • azure_openai_api_version: Azure OpenAI API version., ${{ env.AZURE_OPENAI_API_VERSION }}
  • azure_openai_api_credentials: Azure OpenAI API credentials type. Leave as 'default' unless you have a special Azure setup., ${{ env.AZURE_OPENAI_API_CREDENTIALS }}
  • github_token: GitHub token with models: read permission at least (https://microsoft.github.io/genaiscript/reference/github-actions/#github-models-permissions)., ${{ secrets.GITHUB_TOKEN }}

Outputs

  • text: The generated text output.

Usage

Add the following to your step in your workflow file:

uses: pelikhan/action-genai-pull-request-descriptor@main
with:
  github_token: ${{ secrets.GITHUB_TOKEN }}

Example

Save this file in your .github/workflows/ directory as pull-request-descriptor.yml:

name: Action-Genai-Pull-Request-Descriptor
on:
    pull_request:
permissions:
    contents: read
    # issues: write
    pull-requests: write
    models: read
concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true
jobs:
  action_genai_pull_request_descriptor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: .genaiscript/cache/**
          key: genaiscript-${{ github.run_id }}
          restore-keys: |
            genaiscript-
      - uses: pelikhan/action-genai-pull-request-descriptor@v0 # update to the major version you want to use
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Development

This action was automatically generated by GenAIScript from the script metadata. We recommend updating the script metadata instead of editing the action files directly.

  • the action inputs are inferred from the script parameters
  • the action outputs are inferred from the script output schema
  • the action description is the script description
  • the readme description is the script description
  • the action branding is the script branding

To regenerate the action files (action.yml), run:

npm run configure

To lint script files, run:

npm run lint

To typecheck the scripts, run:

npm run typecheck

To build the Docker image locally, run:

npm run docker:build

To run the action locally in Docker (build it first), use:

npm run docker:start

Upgrade

The GenAIScript version is pinned in the package.json file. To upgrade it, run:

npm run upgrade

Release

To release a new version of this action, run the release script on a clean working directory.

npm run release

About

GitHub Action that generates a Pull Request description using GenAI

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published