@@ -14,14 +14,12 @@ jobs:
14
14
env :
15
15
KEYWORDS : ' ["\\?", "please", "kindly", "let me know", "try", "can you", "could you", "would you", "may I", "provide", "let us know", "tell me", "give me", "send me", "what", "when", "where", "why", "how"]'
16
16
steps :
17
- - name : Checkout code
18
- uses : actions/checkout@v3
19
17
- name : Check for author
20
18
uses : actions/github-script@v6
21
19
with :
22
20
github-token : ${{ secrets.GITHUB_TOKEN }}
23
21
script : |
24
- const issue = await github.issues.get({
22
+ const issue = await github.rest. issues.get({
25
23
owner: context.repo.owner,
26
24
repo: context.repo.repo,
27
25
issue_number: context.issue.number
36
34
const shouldAddLabel = isTeamMember && commentAuthor !== issue.data.user.login && isRequestForInfo;
37
35
38
36
if (shouldAddLabel) {
39
- await github.issues.addLabels({
37
+ await github.rest. issues.addLabels({
40
38
owner: context.repo.owner,
41
39
repo: context.repo.repo,
42
40
issue_number: context.issue.number,
@@ -48,22 +46,20 @@ jobs:
48
46
if : contains(github.event.issue.labels.*.name, 'info-needed') && contains(github.event.issue.labels.*.name, 'triage-needed')
49
47
runs-on : ubuntu-latest
50
48
steps :
51
- - name : Checkout code
52
- uses : actions/checkout@v3
53
49
- name : Check for author
54
50
uses : actions/github-script@v6
55
51
with :
56
52
github-token : ${{ secrets.GITHUB_TOKEN }}
57
53
script : |
58
- const issue = await github.issues.get({
54
+ const issue = await github.rest. issues.get({
59
55
owner: context.repo.owner,
60
56
repo: context.repo.repo,
61
57
issue_number: context.issue.number
62
58
});
63
59
const commentAuthor = context.payload.comment.user.login;
64
60
const issueAuthor = issue.data.user.login;
65
61
if (commentAuthor === issueAuthor) {
66
- await github.issues.removeLabel({
62
+ await github.rest. issues.removeLabel({
67
63
owner: context.repo.owner,
68
64
repo: context.repo.repo,
69
65
issue_number: context.issue.number,
77
73
}
78
74
// Loop through all the comments on the issue in reverse order and find the last username that a TRIAGER mentioned
79
75
// If the comment author is the last mentioned username, remove the "info-needed" label
80
- const comments = await github.issues.listComments({
76
+ const comments = await github.rest. issues.listComments({
81
77
owner: context.repo.owner,
82
78
repo: context.repo.repo,
83
79
issue_number: context.issue.number
89
85
const matches = comment.body.match(/@\w+/g) || [];
90
86
const mentionedUsernames = matches.map(match => match.replace('@', ''));
91
87
if (mentionedUsernames.includes(commentAuthor)) {
92
- await github.issues.removeLabel({
88
+ await github.rest. issues.removeLabel({
93
89
owner: context.repo.owner,
94
90
repo: context.repo.repo,
95
91
issue_number: context.issue.number,
0 commit comments