From 98e1c2158b095200225ce0bbead34e884a6277ef Mon Sep 17 00:00:00 2001 From: Uppuluri Kalyani <105410881+UppuluriKalyani@users.noreply.github.com> Date: Sun, 22 Sep 2024 20:14:42 +0530 Subject: [PATCH] Create autocomment-issue.yml --- .github/workflows/autocomment-issue.yml | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/autocomment-issue.yml diff --git a/.github/workflows/autocomment-issue.yml b/.github/workflows/autocomment-issue.yml new file mode 100644 index 0000000..a32955a --- /dev/null +++ b/.github/workflows/autocomment-issue.yml @@ -0,0 +1,36 @@ +name: Auto Comment on Issue + +on: + issues: + types: [opened] + +permissions: + issues: write + +jobs: + comment: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Add Comment to Issue + run: | + COMMENT=$(cat < We are here to help you on this journey of opensource, any help feel free to tag me or [book an appointment](https://topmate.io/sanjaykv)." + } + EOF + ) + RESPONSE=$(curl -s -o response.json -w "%{http_code}" \ + -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \ + -d "$COMMENT") + cat response.json + if [ "$RESPONSE" -ne 201 ]; then + echo "Failed to add comment" + exit 1 + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}