Skip to content

Commit f4f883c

Browse files
author
Kartik Raj
authored
Fix info needed workflow (#21021)
1 parent e288f8b commit f4f883c

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

.github/workflows/triage-info-needed.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ jobs:
1414
env:
1515
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"]'
1616
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@v3
1917
- name: Check for author
2018
uses: actions/github-script@v6
2119
with:
2220
github-token: ${{ secrets.GITHUB_TOKEN }}
2321
script: |
24-
const issue = await github.issues.get({
22+
const issue = await github.rest.issues.get({
2523
owner: context.repo.owner,
2624
repo: context.repo.repo,
2725
issue_number: context.issue.number
@@ -36,7 +34,7 @@ jobs:
3634
const shouldAddLabel = isTeamMember && commentAuthor !== issue.data.user.login && isRequestForInfo;
3735
3836
if (shouldAddLabel) {
39-
await github.issues.addLabels({
37+
await github.rest.issues.addLabels({
4038
owner: context.repo.owner,
4139
repo: context.repo.repo,
4240
issue_number: context.issue.number,
@@ -48,22 +46,20 @@ jobs:
4846
if: contains(github.event.issue.labels.*.name, 'info-needed') && contains(github.event.issue.labels.*.name, 'triage-needed')
4947
runs-on: ubuntu-latest
5048
steps:
51-
- name: Checkout code
52-
uses: actions/checkout@v3
5349
- name: Check for author
5450
uses: actions/github-script@v6
5551
with:
5652
github-token: ${{ secrets.GITHUB_TOKEN }}
5753
script: |
58-
const issue = await github.issues.get({
54+
const issue = await github.rest.issues.get({
5955
owner: context.repo.owner,
6056
repo: context.repo.repo,
6157
issue_number: context.issue.number
6258
});
6359
const commentAuthor = context.payload.comment.user.login;
6460
const issueAuthor = issue.data.user.login;
6561
if (commentAuthor === issueAuthor) {
66-
await github.issues.removeLabel({
62+
await github.rest.issues.removeLabel({
6763
owner: context.repo.owner,
6864
repo: context.repo.repo,
6965
issue_number: context.issue.number,
@@ -77,7 +73,7 @@ jobs:
7773
}
7874
// Loop through all the comments on the issue in reverse order and find the last username that a TRIAGER mentioned
7975
// 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({
8177
owner: context.repo.owner,
8278
repo: context.repo.repo,
8379
issue_number: context.issue.number
@@ -89,7 +85,7 @@ jobs:
8985
const matches = comment.body.match(/@\w+/g) || [];
9086
const mentionedUsernames = matches.map(match => match.replace('@', ''));
9187
if (mentionedUsernames.includes(commentAuthor)) {
92-
await github.issues.removeLabel({
88+
await github.rest.issues.removeLabel({
9389
owner: context.repo.owner,
9490
repo: context.repo.repo,
9591
issue_number: context.issue.number,

0 commit comments

Comments
 (0)