From 0896c0439682dc9d783d2a74e58ae9771b3a5233 Mon Sep 17 00:00:00 2001 From: Mayank Mohapatra <125661248+Mayank77maruti@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:34:37 +0530 Subject: [PATCH] Create reviewer.yml --- .github/workflows/reviewer.yml | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/reviewer.yml diff --git a/.github/workflows/reviewer.yml b/.github/workflows/reviewer.yml new file mode 100644 index 0000000..1e60936 --- /dev/null +++ b/.github/workflows/reviewer.yml @@ -0,0 +1,40 @@ +name: Request Screenshot or Video + +on: + pull_request: + types: + - opened + +permissions: + pull-requests: write + +jobs: + comment_on_pr: + name: Request Screenshot/Video + runs-on: ubuntu-latest + + steps: + - name: Comment on the PR + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { context } = require("@actions/github"); + const prNumber = context.payload.pull_request.number; + const owner = context.payload.repository.owner.login; + const repo = context.payload.repository.name; + + const message = ` + 👋 Hello @${context.payload.pull_request.user.login}, thank you for opening this pull request! + + To help with the review process, could you please attach a **screenshot** or a **video** demonstrating the changes you've made? This will make it easier for reviewers to understand the impact of your contribution. + + Thank you for your efforts! 🚀 + `; + + await github.issues.createComment({ + owner: owner, + repo: repo, + issue_number: prNumber, + body: message + });