From 9c0ca427f644f1914e2f424c99a677e8b691077f Mon Sep 17 00:00:00 2001 From: Ambati Sahithi <162500856+asr2003@users.noreply.github.com> Date: Wed, 29 May 2024 00:37:10 +0530 Subject: [PATCH] Add auto-comment.yml --- .github/workflows/auto-comment.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/auto-comment.yml diff --git a/.github/workflows/auto-comment.yml b/.github/workflows/auto-comment.yml new file mode 100644 index 00000000..7f9a5505 --- /dev/null +++ b/.github/workflows/auto-comment.yml @@ -0,0 +1,25 @@ +name: Auto Comment on Merged PR + +on: + pull_request: + types: [closed] + +jobs: + comment: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Comment on merged pull request + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const pr_number = context.payload.pull_request.number; + const comment = "Thank you for your contribution! 🎉 Your pull request has been successfully merged."; + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: pr_number, + body: comment + });