- Composite GitHub Actions for automatically refining Issue and Pull Request descriptions
- Uses OpenAI’s GPT-4 to generate improved descriptions
- Requires GitHub token and OpenAI API key for authentication
- Includes two actions: On Issues Opened and On Pull Request Opened
- Easily extensible and customizable
- GitHub Token: Required to interact with GitHub’s REST API
- OpenAI API Key: Required for invoking GPT-4 completions
- jq & curl: Required by the composite Actions to process JSON and make HTTP requests
For local testing, make sure you have
jq
andcurl
installed on your development machine (e.g.,sudo apt-get install -y jq curl
).
- Clone or fork this repository in your own GitHub account.
- Review and set the appropriate permissions for your GitHub token (typically
repo
permissions are sufficient). - Configure the input fields in the
action.yml
files (e.g.,github_token
,openai_api_key
,issue_template
,pull_request_template
) based on your project’s needs. - Include these actions in your workflow by referencing their paths (e.g.,
.github/actions/your-actions-folder
) or by copying them directly into your repository.
- On Issues Opened:
- Triggered automatically whenever an Issue is opened in your repository.
- Updates the Issue body with an improved, AI-generated description based on your issue template.
- On Pull Request Opened:
- Triggered automatically whenever a Pull Request is opened in your repository.
- Updates the PR body with an improved, AI-generated description based on your pull request template.
Example workflow snippet:
name: Refine Descriptions
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
refine-issues-and-prs:
runs-on: ubuntu-latest
steps:
- name: Use On Issues Opened Action
if: ${{ github.event_name == 'issues' }}
uses: ./.github/actions/on-issues-opened
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
- name: Use On Pull Request Opened Action
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/on-pull-request-opened
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_api_key: ${{ secrets.OPENAI_API_KEY }}
- You can open a dummy Issue or create a test Pull Request in a non-production environment (e.g., a fork or test repository) to verify that the Action updates the descriptions as expected.
- Debug logs can be viewed in your GitHub Actions run (under your repository’s Actions tab).
- Guidelines: Please follow the standard GitHub Fork-and-Pull model. Fork the repository, make your changes, and open a Pull Request.
- Coding Standards: Use descriptive commit messages and ensure all scripts are properly formatted (e.g., shell scripts).
- Development Methodologies: We recommend small, incremental changes. For major changes, please open an Issue to discuss the proposal first.
- Style Guides: Adhere to conventional commits or a similarly consistent commit/PR structure.
- GitHub Actions Marketplace: If you wish to distribute these Actions to a broader audience, publish them to the GitHub Actions Marketplace.
- Production vs. Staging: Consider using separate branches (e.g.,
main
for production,dev
for staging). Update youraction.yml
in each branch to point to the correct versions.
- GitHub Actions (Composite Actions)
- OpenAI GPT-4 for generating improved content
- jq for JSON parsing
- curl for HTTP requests
- Bash scripting for automation
This project uses Semantic Versioning 2.0.0.
Distributed under the MIT License.