I have the following:
if address :all :contains "from" ["
github.com"] {
addflag "github";
addflag "MyFlags" "github";
set "mailbox" "GitHub";
if address :matches :user "to" "*" {
set "GHUser" "${1}";
addflag "${GHUser}";
addflag "MyFlags" "${GHuser}";
}
if header :matches "List-ID" "(.*/.*) <(.*)>" {
set "mailbox" "github-lists/${1}";
}
fileinto :flags "${MyFlags}" :create "${mailbox}";
stop;
}