-
Notifications
You must be signed in to change notification settings - Fork 40
46 lines (44 loc) · 1.5 KB
/
Welcome.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
name: Welcome New Contributors
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
jobs:
welcome:
runs-on: ubuntu-latest
steps:
- name: Welcome Issue
if: github.event_name == 'issues'
uses: actions/github-script@v6
with:
script: |
const issue = context.issue;
const repo = context.repo;
const issueAuthor = context.payload.sender.login;
const welcomeMessage = `
Hi @${issueAuthor}! :wave:
Thank you for creating an issue in our repository! We appreciate your contribution and will get back to you as soon as possible.
`;
github.rest.issues.createComment({
...repo,
issue_number: issue.number,
body: welcomeMessage
});
- name: Welcome Pull Request
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v6
with:
script: |
const pr = context.issue;
const repo = context.repo;
const prAuthor = context.payload.sender.login;
const welcomeMessage = `
Hi @${prAuthor}! :wave:
Thank you for submitting a pull request! We appreciate your contribution and will review your changes as soon as possible.
`;
github.rest.issues.createComment({
...repo,
issue_number: pr.number,
body: welcomeMessage
});