webpack/open-bot.yaml

328 lines
8.5 KiB
YAML
Raw Normal View History

bot: "webpack-bot"
rules:
2018-10-24 10:52:20 +02:00
# add conflict label to pull requests with conflict
# on conflict all result labels are removed
- filters:
open: true
pull_request:
mergeable: false
actions:
label:
add: "PR: conflict"
- filters:
open: true
pull_request:
mergeable: true
actions:
label:
remove: "PR: conflict"
# add unreviewed, reviewed, review-outdated labels
# comment to ping reviewer
# comment on new PR
- filters:
open: true
in_order:
commit: true
review:
state: APPROVED|CHANGES_REQUESTED
ensure:
value: "{{review.state}}"
equals: APPROVED
permission:
user: "{{review.user.login}}"
actions:
label:
add: "PR: reviewed-approved"
remove:
- "PR: review-outdated"
- "PR: unreviewed"
- "PR: reviewed"
- filters:
open: true
in_order:
commit: true
review:
state: APPROVED|CHANGES_REQUESTED
permission:
user: "{{review.user.login}}"
ensure:
value: "{{review.state}}"
equals: CHANGES_REQUESTED
actions:
label:
add: "PR: reviewed-changes-requested"
remove:
- "PR: review-outdated"
- "PR: unreviewed"
- "PR: reviewed"
- filters:
open: true
in_order:
review:
state: APPROVED|CHANGES_REQUESTED
commit: true
permission:
user: "{{review.user.login}}"
not:
label: "review-outdated"
ensure:
value: "{{commit.author.login}}"
notEquals: "{{review.user.login}}"
actions:
label:
add: "PR: review-outdated"
remove:
- "PR: reviewed-approved"
- "PR: reviewed-changes-requested"
- "PR: unreviewed"
- "PR: reviewed"
comment:
identifier: "review-outdated"
message: |-
@{{commit.author.login}} Thanks for your update.
I labeled the Pull Request so reviewers will review it again.
@{{review.user.login}} Please review the new changes.
- filters:
open: true
commit: true
not:
review:
state: APPROVED|CHANGES_REQUESTED
actions:
label: "PR: unreviewed"
# add non-main, dev-1, webpack-4 and next label to pull request to other branch
2018-10-24 10:52:20 +02:00
- filters:
pull_request:
2021-06-28 11:46:10 +02:00
base_ref: "^main$"
2018-10-24 10:52:20 +02:00
actions:
label:
remove:
- "PR: next"
- "PR: dev-1"
- "PR: webpack-4"
- "PR: non-main"
- filters:
pull_request:
base_ref: "^dev-1$"
actions:
label:
add: "PR: dev-1"
2019-12-27 21:42:24 +01:00
remove:
- "PR: next"
- "PR: webpack-4"
2021-06-28 11:46:10 +02:00
- "PR: non-main"
2018-10-24 10:52:20 +02:00
- filters:
pull_request:
base_ref: "^next$"
actions:
label:
add: "PR: next"
2019-12-27 21:42:24 +01:00
remove:
- "PR: dev-1"
- "PR: webpack-4"
2021-06-28 11:46:10 +02:00
- "PR: non-main"
2019-12-27 21:42:24 +01:00
- filters:
pull_request:
base_ref: "^webpack-4$"
actions:
label:
add: "PR: webpack-4"
remove:
- "PR: dev-1"
- "PR: next"
2021-06-28 11:46:10 +02:00
- "PR: non-main"
2018-10-24 10:52:20 +02:00
- filters:
pull_request:
2021-06-28 11:46:10 +02:00
base_ref: "^(?!main$)(?!webpack-4$)(?!next$)"
2018-10-24 10:52:20 +02:00
actions:
label:
2021-06-28 11:46:10 +02:00
add: "PR: non-main"
2019-12-27 21:42:24 +01:00
remove:
- "PR: dev-1"
- "PR: next"
- "PR: webpack-4"
2018-10-24 10:52:20 +02:00
# show hint about contributing
2018-10-24 10:52:20 +02:00
- filters:
open: true
age:
minimum: 1d
maximum: 1w
pull_request:
2021-06-28 11:46:10 +02:00
head_ref: "^main$"
2018-10-24 10:52:20 +02:00
permission: "read|none"
actions:
comment:
2021-06-28 11:46:10 +02:00
identifier: "head-main"
2018-10-24 10:52:20 +02:00
edit: true
message: |-
Hi @{{pull_request.user.login}}.
2018-10-24 10:52:20 +02:00
Just a little hint from a friendly bot about the best practice when submitting pull requests:
2021-06-28 11:46:10 +02:00
> Don't submit pull request from your own `main` branch. It's recommended to create a feature branch for the PR.
2018-10-24 10:52:20 +02:00
*You don't have to change it for this PR, just make sure to follow this hint the next time you submit a PR.*
# add "Send a PR" label when somebody with write permission say it
- filters:
open: true
comment: "[Ss]end a [Pp][Rr]"
permission:
user: "{{comment.actor.login}}"
actions:
label: "Send a PR"
# Move issue task
- filters:
open: true
2018-11-02 11:04:02 +01:00
comment: "\\s*@webpack-bot\\s+move\\s+(?:to\\s+)?([a-z0-9_\\-\\.]+/[a-z0-9_\\-\\.]+)\\s*([\\s\\S]*)$"
2018-10-24 10:52:20 +02:00
not:
comment_1:
matching: "moved\\-by\\-bot"
author: "."
permission:
user: "{{comment.actor.login}}"
actions:
new_issue:
target: "{{{comment_match.[1]}}}"
body: |-
{{{issue.body}}}
---
This issue was moved from {{owner}}/{{repo}}#{{issue.number}} by @{{comment.actor.login}}. Original issue was by @{{issue.user.login}}.
{{{comment_match.[2]}}}
comment:
identifier: moved-by-bot
message: |-
I've moved it to {{comment_match.[1]}}.
close: true
# mark inactive issues with inactive label
# close them when no activity after warning
- filters:
issue: true
open: true
not:
label: inactive
ensure:
value: "{{issue.reactions.[+1]}}"
range: "< 10"
2018-10-24 20:10:30 +02:00
last_action_age: 13w # three months
2018-10-24 10:52:20 +02:00
actions:
comment:
identifier: inactive-warning
2018-10-24 10:52:20 +02:00
message: |-
2018-10-24 20:10:30 +02:00
**This issue had no activity for at least three months.**
2018-10-24 10:52:20 +02:00
It's subject to automatic issue closing if there is no activity in the next 15 days.
label: inactive
- filters:
open: true
label: inactive
last_action_age:
2018-10-24 20:10:30 +02:00
maximum: 13w # three months
2018-10-24 10:52:20 +02:00
actions:
label:
remove:
- inactive
- filters:
open: true
label: inactive
last_action_age:
minimum: 15d
includeBotActions: true
actions:
close: true
comment:
identifier: inactive-close
2018-10-24 10:52:20 +02:00
message: |-
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.
# Add action actions box to each pull request
- filters:
pull_request: true
open: true
not:
comment:
matching: admin-actions
author: webpack-bot
actions:
comment:
identifier: admin-actions
message: |-
*For maintainers only:*
2019-06-24 14:53:54 +02:00
* [ ] <!-- document --> This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
* [ ] <!-- webpack-4-backport --> This needs to be backported to webpack 4 (issue will be created when merged)
2018-10-24 10:52:20 +02:00
# When a pull request need to be documented, create an issue in webpack/webpack.js.org when merged
- filters:
pull_request:
merged: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] <!-- document -->"
not:
comment_1:
author: webpack-bot
matching: admin-action-document-executed
actions:
new_issue:
target: webpack/webpack.js.org
title: "Document webpack change: {{{pull_request.title}}}"
body: |-
<!-- documentation request from webpack/webpack -->
2018-10-24 10:52:20 +02:00
*A pull request by @{{pull_request.user.login}} was merged and maintainers requested a documentation change.*
2018-10-24 10:52:20 +02:00
See pull request: {{{pull_request.html_url}}}
2018-10-24 10:52:20 +02:00
---
2018-10-24 10:52:20 +02:00
{{{pull_request.body}}}
comment:
identifier: admin-action-document-executed
message: |-
I've created an issue to document this in webpack/webpack.js.org.
# When a pull request need to be backported, create an issue in webpack/webpack when merged
- filters:
pull_request:
merged: true
comment:
author: webpack-bot
matching: "\\* \\[x\\] <!-- webpack-4-backport -->"
not:
comment_1:
author: webpack-bot
matching: admin-action-webpack-4-backport-executed
actions:
new_issue:
target: webpack/webpack
title: "Backport to webpack 4: {{{pull_request.title}}}"
body: |-
{{{pull_request.html_url}}} needs to be backported to webpack 4.
2019-11-15 10:20:45 +01:00
Send a PR.
2019-11-15 10:20:45 +01:00
cc @{{pull_request.user.login}}
comment:
identifier: admin-action-webpack-4-backport-executed
message: |-
I've created an issue to backport this.
2018-10-24 10:52:20 +02:00
# Check open issues and pull requests every day
- filters:
open: true
actions:
schedule: 1d