From 174c68f9d9d76abdc2307788704bac5eb0c7076b Mon Sep 17 00:00:00 2001 From: Pavankumar Hegde <85627085+hegdepavankumar@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:41:58 +0530 Subject: [PATCH] Create thank_you.yml --- .github/workflows/thank_you.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/thank_you.yml diff --git a/.github/workflows/thank_you.yml b/.github/workflows/thank_you.yml new file mode 100644 index 0000000..647b159 --- /dev/null +++ b/.github/workflows/thank_you.yml @@ -0,0 +1,28 @@ +name: Thank You on Star + +on: + watch: + types: [started] + +jobs: + thank: + runs-on: ubuntu-latest + steps: + - name: Thank the user + run: | + access_token=$GITHUB_TOKEN + username=hegdepavankumar + repo=VMware-Workstation-Pro-17-Licence-Keys + issue_number=1 + + api_url="https://api.github.com/repos/${username}/${repo}/issues/${issue_number}/comments" + message="Thank you, @${{ github.actor }} 🌟! We appreciate your support." + + response=$(curl -X POST -s -H "Authorization: Bearer $access_token" -H "Accept: application/vnd.github.v3+json" -d "{\"body\":\"$message\"}" $api_url) + + if [[ $(echo $response | jq -r '.id') != null ]]; then + echo "Thank-you message posted successfully!" + else + echo "Error posting thank-you message. Response: $response" + exit 1 + fi