From 2ffe10edbbd1ee4dd44abdeea05b15cb0174c166 Mon Sep 17 00:00:00 2001 From: ellio Date: Mon, 5 May 2025 13:27:29 +0200 Subject: [PATCH] commit1 --- .github/workflows/comment-pr.yml | 20 +++++++++++++++++++ .github/workflows/pr-notifier.yml | 32 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/comment-pr.yml create mode 100644 .github/workflows/pr-notifier.yml diff --git a/.github/workflows/comment-pr.yml b/.github/workflows/comment-pr.yml new file mode 100644 index 000000000..697d4693d --- /dev/null +++ b/.github/workflows/comment-pr.yml @@ -0,0 +1,20 @@ +name: Comment PR with AI Review + +on: + workflow_dispatch: + inputs: + pr_number: + required: true + comment_body: + required: true + +jobs: + comment: + runs-on: ubuntu-latest + steps: + - name: Comment on PR with AI Review + uses: peter-evans/create-or-update-comment@v3 + with: + token: ${{ secrets.PAT_GH_ACTIONS }} + issue-number: ${{ github.event.inputs.pr_number }} + body: ${{ github.event.inputs.comment_body }} \ No newline at end of file diff --git a/.github/workflows/pr-notifier.yml b/.github/workflows/pr-notifier.yml new file mode 100644 index 000000000..8c92518f4 --- /dev/null +++ b/.github/workflows/pr-notifier.yml @@ -0,0 +1,32 @@ +name: PR Notifier + +on: + pull_request: + types: [opened, synchronize] + +jobs: + notify: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Zip Repository + run: | + zip -r project.zip . + + - name: Send Data to Target Repo + run: | + curl -X POST "https://api.github.com/repos/emimor-2/AICodeReviewTest/actions/workflows/process-pr.yml/dispatches" \ + -H "Accept: application/vnd.github.everest-preview+json" \ + -H "Authorization: Bearer ${{ secrets.PAT_GH_ACTIONS }}" \ + -d '{ + "ref": "main", + "inputs": { + "pr_number": "${{ github.event.pull_request.number }}", + "repo": "${{ github.repository }}", + "branch": "${{ github.event.pull_request.head.ref }}", + "zip_url": "https://github.com/${{ github.repository }}/archive/${{ github.event.pull_request.head.sha }}.zip" + } + }' \ No newline at end of file