Skip to content

Commit dc922c3

Browse files
committed
Silence the ready reminder when the author is a member of repository
1 parent bdb4471 commit dc922c3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/handlers/shortcut.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
use crate::{
66
config::ShortcutConfig,
77
db::issue_data::IssueData,
8-
github::{AuthorAssociation, Event, Label},
8+
github::{Event, Label},
99
handlers::Context,
1010
interactions::ErrorComment,
1111
};
12+
use octocrab::models::AuthorAssociation;
1213
use parser::command::shortcut::ShortcutCommand;
1314

1415
/// Key for the state in the database
@@ -65,7 +66,16 @@ pub(super) async fn handle_command(
6566
}
6667

6768
// We add a small reminder for the author to use `@bot ready` when ready
68-
if matches!(input, ShortcutCommand::Author) {
69+
//
70+
// Except if the author is a member (or the owner) of the repository, as
71+
// the author should already know about the `ready` command and already
72+
// have the required permissions to update the labels manually anyway.
73+
if matches!(input, ShortcutCommand::Author)
74+
&& !matches!(
75+
issue.author_association,
76+
AuthorAssociation::Member | AuthorAssociation::Owner
77+
)
78+
{
6979
// Get the state of the author reminder for this PR
7080
let mut db = ctx.db.get().await;
7181
let mut state: IssueData<'_, AuthorReminderState> =

0 commit comments

Comments
 (0)