-
Notifications
You must be signed in to change notification settings - Fork 5.6k
chore: add bot to comment on PRs #28953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a bot that automates commenting and labeling pull requests by adding a new JavaScript script and configuring a corresponding GitHub Actions workflow.
- Added a script (tools/label_pull_request.js) to create a comment and update labels when a pull request is opened, reopened, or review requested.
- Added a GitHub Actions workflow (.github/workflows/pull_request_labels.yaml) to trigger the script on defined pull request events.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tools/label_pull_request.js | Adds bot functionality to comment on and label pull requests. |
.github/workflows/pull_request_labels.yaml | Configures the GitHub Action to run the bot for specific PR events. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
}); | ||
} | ||
|
||
// TODO(bartlomieju): figure out how to use ES modules in GH Actions scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work well like below.
tools/package.json
{
"type": "module"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it may work well with just .mjs
although it is not documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self and @dsherret - make sure that CI actually runs on draft PRs, change the "ci-draft" label to "draft-no-ci" (flip to logic so that label disables CI(
repo: context.repo.repo, | ||
}); | ||
const labelNames = result.data.map((label) => label.name); | ||
labelNames.push("pr:needs-review"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create this label before landing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to actually add a label, once a review is requested
repo: context.repo.repo, | ||
body: `Thanks for the PR! | ||
|
||
Once you are done, please request a review from a Deno team member.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If this PR is not ready for a review, please mark it as a draft"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add "pr:waiting-for-author" label, if any person from denoland org submits a review with a comment, this label should be added automatically (and removed once a review is requested again).
No description provided.