Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
c5041f89
Unverified
Commit
c5041f89
authored
Aug 21, 2025
by
Simon Mo
Committed by
GitHub
Aug 21, 2025
Browse files
[CI] improve pr comments bot (#23380)
parent
8b5fe6eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
.github/workflows/reminder_comment.yml
.github/workflows/reminder_comment.yml
+8
-10
No files found.
.github/workflows/reminder_comment.yml
View file @
c5041f89
...
@@ -17,20 +17,18 @@ jobs:
...
@@ -17,20 +17,18 @@ jobs:
const prAuthor = context.payload.pull_request.user.login;
const prAuthor = context.payload.pull_request.user.login;
// Check if this is the author's first PR in this repository
// Check if this is the author's first PR in this repository
const { data: allPRs } = await github.rest.pulls.list({
// Use GitHub's search API to find all PRs by this author
owner: context.repo.owner,
const { data: searchResults } = await github.rest.search.issuesAndPullRequests({
repo: context.repo.repo,
q: `repo:${context.repo.owner}/${context.repo.repo} type:pr author:${prAuthor}`,
state: 'all',
per_page: 100
per_page: 100
});
});
// Filter to find PRs by this author
const authorPRCount = searchResults.total_count;
const authorPRs = allPRs.filter(pr => pr.user.login === prAuthor);
console.log(`Found ${authorPR
s.length
} PRs by ${prAuthor}`);
console.log(`Found ${authorPR
Count
} PRs by ${prAuthor}`);
// Only post comment if this is the first PR (only one PR by this author)
// Only post comment if this is the first PR (only one PR by this author)
if (authorPR
s.length
=== 1) {
if (authorPR
Count
=== 1) {
console.log(`Posting welcome comment for first-time contributor: ${prAuthor}`);
console.log(`Posting welcome comment for first-time contributor: ${prAuthor}`);
await github.rest.issues.createComment({
await github.rest.issues.createComment({
owner: context.repo.owner,
owner: context.repo.owner,
...
@@ -46,7 +44,7 @@ jobs:
...
@@ -46,7 +44,7 @@ jobs:
'🚀'
'🚀'
});
});
} else {
} else {
console.log(`Skipping comment for ${prAuthor} - not their first PR (${authorPR
s.length
} PRs found)`);
console.log(`Skipping comment for ${prAuthor} - not their first PR (${authorPR
Count
} PRs found)`);
}
}
} catch (error) {
} catch (error) {
console.error('Error checking PR history or posting comment:', error);
console.error('Error checking PR history or posting comment:', error);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment