From e4353fd3b15a8a0e478b708215e03118ff55a9fa Mon Sep 17 00:00:00 2001 From: Pradnya Gaitonde <116059908+PradnyaGaitonde@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:46:06 +0530 Subject: [PATCH] Update autocomment_issue.yml --- .github/workflow/autocomment_issue.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflow/autocomment_issue.yml b/.github/workflow/autocomment_issue.yml index d79efc3..ae5f894 100644 --- a/.github/workflow/autocomment_issue.yml +++ b/.github/workflow/autocomment_issue.yml @@ -1,21 +1,19 @@ -name: Auto Comment on PR Merge +name: Auto Comment on Issue on: - pull_request: - types: [closed] + issues: + types: [opened] jobs: comment: - if: github.event.pull_request.merged == true runs-on: ubuntu-latest - steps: - - name: Add Comment to Merged PR - env: - GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} - run: | - curl -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - -d '{"body":"🎉 Your pull request has been successfully merged! 🎉 Thank you for your contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀"}' \ - "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" + - name: Add Comment to Issue + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ + -d "{\"body\":\"Thank you for creating this issue! 🎉 We'll look into it as soon as possible.\"}"