-
Notifications
You must be signed in to change notification settings - Fork 30
47 lines (41 loc) · 1.38 KB
/
greeting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Greet New Contributors
on:
issues:
types: [opened]
pull_request:
types: [opened]
permissions:
issues: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Greet for issue
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: actions/github-script@v6
with:
script: |
const issueComment = `
Hello @${context.payload.sender.login}, thank you for raising the issue. Your contribution is greatly appreciated and we look forward to addressing it.
`
github.rest.issues.createComment({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: issueComment,
})
- name: Greet for pull request
if: github.event_name == 'pull_request' && github.event.action == 'opened'
uses: actions/github-script@v6
with:
script: |
const prComment = `
Thank you, @${context.payload.sender.login}, for the pull request. We will take a look at it and get back to you shortly.
`
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: prComment,
})