From fd3b1d4b6109e92cdf8dd954e93a80b1a51482a8 Mon Sep 17 00:00:00 2001 From: Uppuluri Kalyani <105410881+UppuluriKalyani@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:11:58 +0530 Subject: [PATCH] Create autocomment-iss-close.yml --- .github/workflows/autocomment-iss-close.yml | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/autocomment-iss-close.yml diff --git a/.github/workflows/autocomment-iss-close.yml b/.github/workflows/autocomment-iss-close.yml new file mode 100644 index 00000000..a5314a92 --- /dev/null +++ b/.github/workflows/autocomment-iss-close.yml @@ -0,0 +1,29 @@ +name: Comment on Issue Close + +on: + issues: + types: [closed] + +jobs: + greet-on-close: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Greet User + uses: actions/github-script@v5 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue = context.payload.issue; + const issueCreator = issue.user.login; + const issueNumber = issue.number; + + const greetingMessage = `Hello @${issueCreator}! Your issue #${issueNumber} has been closed. Thank you for your contribution!`; + + github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body: greetingMessage + });