Welcome to the Warestack Workflow Copilot Action repository! This action is designed to automatically analyze logs from your GitHub workflows, identify errors, and suggest fixes through auto-generated pull requests, enhancing the efficiency of your CI/CD pipeline.
- Trigger: Activates upon the completion of specified workflows.
- Log Retrieval: Fetches logs from workflow runs using GitHub API.
- Error Analysis: Utilizes OpenAI to analyze logs and highlight errors.
- Issue Management: Creates GitHub issues for each identified error with detailed descriptions.
- Automated Fixes: Generates patch suggestions and applies them to new branches.
- Pull Requests: Automatically creates pull requests linking to the issues, streamlining the review and merge process.
- Automated Log Analysis: Identifies errors in workflow logs.
- Issue Creation: Automatically generates and creates issue tickets on GitHub.
- Code Patch Generation: Proposes code fixes and prepares patches.
- Branch and PR Automation: Handles branching and pull requests for code fixes.
To use this action in your projects, add the following workflow to your
.github/workflows
folder:
name: Warestack Copilot
on:
workflow_run:
workflows: ['Main CI'] # Name of the primary workflow
types:
- completed
jobs:
copilot-job:
runs-on: ubuntu-latest
name: Warestack Workflow Copilot
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_GITHUB_TOKEN }} # Token with workflows scope
- name: Trigger Copilot Action
uses: warestack/action-copilot@main
with:
github-token: ${{ secrets.PAT_GITHUB_TOKEN }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
workflow-run-id: ${{ github.event.workflow_run.id }} # ID of the completed workflow run
github-token
: Token for the GitHub API. Must have appropriate permissions to fetch logs, create branches, issues, and pull requests.openai-api-key
: Key for OpenAI API to perform automated log analysis and patch generation.
Ensure the GITHUB_TOKEN or the personal access token used has the following permissions:
repo
(all): For operations on the repository.actions
: For accessing workflow runs.workflows
: For modifying workflow files.
Always store your PAT_GITHUB_TOKEN
and OPENAI_API_KEY
as secrets. Never hard
code them into your workflow files.
We believe in the power of the community. Any contributions you make are greatly appreciated. Check our Contributing Guide for more information.
This project is licensed under the MIT License - see the LICENSE file for details.
❤️ Made with passion by the Warestack Team. Join our Community Discord to discuss and contribute!