From f012fdc760794b00447cf093dfc0e3a318cd5847 Mon Sep 17 00:00:00 2001 From: "harshil15999 a.k.a dark0angel" Date: Fri, 31 May 2024 00:46:16 +0530 Subject: [PATCH 01/12] Create greetings.yml --- .github/workflows/greetings.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 0000000..c6a96bb --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,16 @@ +name: Greetings + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: "Message that will be displayed on users' first issue" + pr-message: "Message that will be displayed on users' first pull request" From a119e6b95e2f83f990b94be686f130b05d96f1c7 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 00:51:54 +0530 Subject: [PATCH 02/12] adding welome bot --- .github/workflows/greetings.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index c6a96bb..522478b 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -14,3 +14,25 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} issue-message: "Message that will be displayed on users' first issue" pr-message: "Message that will be displayed on users' first pull request" + + - name: Greet user on every pull request + if: github.event_name == 'pull_request' + uses: actions/github-script@v4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const comment = ` + Hello @${github.context.payload.pull_request.user.login}! + + Thank you for opening a pull request. We appreciate your contribution. + + Please make sure to follow our contribution guidelines and address any feedback that we provide. + + Thanks again! + ` + github.rest.issues.createComment({ + issue_number: github.context.payload.pull_request.number, + owner: github.context.repo.owner, + repo: github.context.repo.repo, + body: comment + }) From 58a84c23aa80eac63c8b9ac030f27ceac0a1f465 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 00:56:51 +0530 Subject: [PATCH 03/12] adding welome bot --- .github/workflows/greetings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 522478b..2c86247 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -22,7 +22,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const comment = ` - Hello @${github.context.payload.pull_request.user.login}! + Hello @${github.event.pull_request.user.login}!}! Thank you for opening a pull request. We appreciate your contribution. @@ -31,7 +31,7 @@ jobs: Thanks again! ` github.rest.issues.createComment({ - issue_number: github.context.payload.pull_request.number, + issue_number: github.event.pull_request.number, owner: github.context.repo.owner, repo: github.context.repo.repo, body: comment From 628d76902442a84d6c3f738e807fcfe5674a5850 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 00:59:03 +0530 Subject: [PATCH 04/12] adding welome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 2c86247..b7c29a7 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -1,6 +1,6 @@ name: Greetings -on: [pull_request, issues] +on: [pull_request_target, issues] jobs: greeting: From 798e5b741b18d9b35518c6eafb2f777eee2e8304 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 01:42:23 +0530 Subject: [PATCH 05/12] Adding welcome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index b7c29a7..c267210 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -16,7 +16,7 @@ jobs: pr-message: "Message that will be displayed on users' first pull request" - name: Greet user on every pull request - if: github.event_name == 'pull_request' + if: github.event_name == "pull_request" uses: actions/github-script@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} From f43b849e50f16b976bb0010892f03fc8059e4f31 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 01:46:44 +0530 Subject: [PATCH 06/12] Adding welcome bot --- .github/workflows/greetings.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index c267210..3e7a3a0 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -17,7 +17,7 @@ jobs: - name: Greet user on every pull request if: github.event_name == "pull_request" - uses: actions/github-script@v4 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | @@ -30,9 +30,9 @@ jobs: Thanks again! ` - github.rest.issues.createComment({ - issue_number: github.event.pull_request.number, - owner: github.context.repo.owner, - repo: github.context.repo.repo, - body: comment - }) + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }) \ No newline at end of file From a28e1a734e5fa5c1285c604daa3cd85335284261 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 01:48:12 +0530 Subject: [PATCH 07/12] Adding welcome bot --- .github/workflows/greetings.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 3e7a3a0..cf77f66 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,12 +9,6 @@ jobs: issues: write pull-requests: write steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: "Message that will be displayed on users' first issue" - pr-message: "Message that will be displayed on users' first pull request" - - name: Greet user on every pull request if: github.event_name == "pull_request" uses: actions/github-script@v7 @@ -33,6 +27,6 @@ jobs: await github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, - repo: context.repo.repo, + repo: context.repo.repo, body: comment }) \ No newline at end of file From c0b6ba68565f5d28b6bba117892156c088c5643e Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 01:53:58 +0530 Subject: [PATCH 08/12] Adding welcome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index cf77f66..59a4d32 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -10,7 +10,7 @@ jobs: pull-requests: write steps: - name: Greet user on every pull request - if: github.event_name == "pull_request" + if: github.event_name == 'pull_request' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 0803410ad74cf00d45a9ddfb5065ee7e33ce43d2 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 01:57:44 +0530 Subject: [PATCH 09/12] Adding welcome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 59a4d32..53a083a 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -10,7 +10,7 @@ jobs: pull-requests: write steps: - name: Greet user on every pull request - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request_target' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 5da80ab333f5c0f197f55322c90bf2d9c3ae578a Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 02:02:29 +0530 Subject: [PATCH 10/12] Adding welcome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index 53a083a..d4eed72 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -16,7 +16,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const comment = ` - Hello @${github.event.pull_request.user.login}!}! + Hello ! Thank you for opening a pull request. We appreciate your contribution. From feba91dafc743b96e48e11c0706d3425b2eb84ba Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 11:56:41 +0530 Subject: [PATCH 11/12] Adding welcome bot --- .github/workflows/greetings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index d4eed72..d8fb39a 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -20,7 +20,9 @@ jobs: Thank you for opening a pull request. We appreciate your contribution. - Please make sure to follow our contribution guidelines and address any feedback that we provide. + Please make sure to read our contribution guidelines and let us get back to you. + + In the meantime grab a cup of :coffee Thanks again! ` From ca881282ecbc3bb8c539a7ce27db3458fa901680 Mon Sep 17 00:00:00 2001 From: harshil15999 Date: Fri, 31 May 2024 11:58:18 +0530 Subject: [PATCH 12/12] Adding welcome bot --- .github/workflows/greetings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index d8fb39a..9706383 100644 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -22,7 +22,7 @@ jobs: Please make sure to read our contribution guidelines and let us get back to you. - In the meantime grab a cup of :coffee + In the meantime grab a cup of :coffee: Thanks again! `