diff --git a/.github/workflows/generate-pr-description.yml b/.github/workflows/generate-pr-description.yml new file mode 100644 index 0000000..56324ab --- /dev/null +++ b/.github/workflows/generate-pr-description.yml @@ -0,0 +1,56 @@ +name: Generate PR Description + +on: pull_request + +jobs: + generate-pr-description: + runs-on: ubuntu-latest + if: github.event.issue.pull_request && contains(github.event.comment.body, '/generate_pr_description') + steps: + - name: Get PR branch + uses: xt0rted/pull-request-comment-branch@v1 + id: comment-branch + + - name: Set latest commit status as pending + uses: myrotvorets/set-commit-status-action@master + with: + sha: ${{ steps.comment-branch.outputs.head_sha }} + token: ${{ secrets.GITHUB_TOKEN }} + status: pending + + - name: Generate PR description + uses: mkarle/skonsole-generate-pr-description@v1 + with: + target-branch: ${{ steps.comment-branch.outputs.base_sha }} + source-branch: ${{ steps.comment-branch.outputs.head_ref }} + token: ${{ secrets.GITHUB_TOKEN }} + update-type: ${{ contains(github.event.comment.body, 'replace') && 'replace' || (contains(github.event.comment.body, 'prefix') && 'prefix' || 'suffix') }} + env: # Set Azure credentials secret as an input + AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_CHAT_DEPLOYMENT_NAME }} + AZURE_OPENAI_API_ENDPOINT: ${{ secrets.AZURE_OPENAI_API_ENDPOINT }} + AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} + + - name: Set latest commit status as ${{ job.status }} + uses: myrotvorets/set-commit-status-action@master + if: always() + with: + sha: ${{ steps.comment-branch.outputs.head_sha }} + token: ${{ secrets.GITHUB_TOKEN }} + status: ${{ job.status }} + + - name: Add comment to PR + uses: actions/github-script@v6 + if: always() + with: + script: | + const name = '${{ github.workflow }}'; + const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; + const success = '${{ job.status }}' === 'success'; + const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; + + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: body + }) diff --git a/README.md b/README.md index 6addf02..4fe399f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,23 @@ +This is a test PR. Please ignore! + # SKonsole - A Console App built on Semantic Skills + This repository contains a demo of a console application called SKonsole, which uses the Semantic Kernel to run various skills. The app currently supports two skills: generating commit messages and generating pull request feedback. The app uses environment variables to configure the Azure OpenAI backend. ## Getting Started + To get started, simply run the following commands in the terminal: ```Copy code apps\SKonsole> dotnet build apps\SKonsole> dotnet run ``` + This should build and run the SKonsole app. Note that you may need to configure your environment variables with your Azure OpenAI credentials before running the app. ## Projects and Classes + This repository contains several projects and classes, including: - PRSkill: A skill that can generate feedback, commit messages, and pull request descriptions based on git diff or git show output. The PRSkill uses the CondenseSkill as a dependency and implements chunking and aggregation mechanisms to handle large inputs. @@ -23,6 +29,7 @@ This repository contains several projects and classes, including: ## Installing SKonsole Tool Install the SKonsole Tool globally with a few quick steps: + ### Installation 1. Open your terminal or command prompt. @@ -31,7 +38,9 @@ Install the SKonsole Tool globally with a few quick steps: ```shell dotnet tool install --global SKonsole ``` + 3. To confirm the installation was successful, run: + ```shell skonsole --version ``` @@ -49,14 +58,19 @@ Install the SKonsole Tool globally with a few quick steps: - `skonsole promptChat`: Engage in interactive prompt chat sessions. ## Dependencies + This project requires the following dependencies: - [Semantic Kernel](https://github.com/microsoft/semantic-kernel) +## Github Action + +Use this as a github action too. TODO + ## Future Work + In the future, the SKonsole app could be expanded to support more skills and to parse arguments on launch. Additionally, the repository could include instructions for setting up NuGet credentials and using a GitHub Package source. I hope this README is helpful for you and others who may use your repository in the future. Let me know if there's anything else I can do to help! - -####_This README was generated using Semantic Kernel_ \ No newline at end of file +#### _This README was generated using Semantic Kernel_ diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..f7879fe Binary files /dev/null and b/output.txt differ