@@ -3,6 +3,7 @@ import { createPackage } from '@lg-tools/create';
3
3
import { installLeafyGreen } from '@lg-tools/install' ;
4
4
import { linkPackages , unlinkPackages } from '@lg-tools/link' ;
5
5
import { lint } from '@lg-tools/lint' ;
6
+ import { releaseBot } from '@lg-tools/slackbot' ;
6
7
import { test } from '@lg-tools/test' ;
7
8
import { update } from '@lg-tools/update' ;
8
9
import { validate } from '@lg-tools/validate' ;
67
68
. option ( '--scope <name>' , 'The NPM organization' )
68
69
. action ( unlinkPackages ) ;
69
70
71
+ /** Slackbot */
72
+ const slackbotCmd = cli . command ( 'slackbot' ) ;
73
+
74
+ /**
75
+ * This command is run by GitHub Actions immediately after \`changeset\`.
76
+ *
77
+ * Must have the \`.env\` variable "SLACK_BOT_TOKEN" set.
78
+ * This is the "Bot User OAuth Token" found at https://api.slack.com/apps/A02H2UGAMDM/oauth, and should start with "xoxb-"
79
+ *
80
+ * To run this automatically, pass in an array of updates (in the format output by \`changeset\`) as the first argument.
81
+ * i.e. \`yarn slackbot '[{"name": "@leafygreen -ui/sample", "version": "0.1.0"}]' \`
82
+ *
83
+ * Optionally pass in a channel name (defaults to 'leafygreen-ui-releases').
84
+ * Valid channels are: \`${Object.keys(Channels).join('`, `')}\`.
85
+ */
86
+ slackbotCmd
87
+ . command ( 'release' )
88
+ . arguments ( '[updates]' )
89
+ . description (
90
+ 'Notifies the MongoDB leafygreen-ui releases channel of any new packages.' ,
91
+ )
92
+ . option ( '-t, --test' , 'Post to `design-system-testing`' , false )
93
+ . option ( '-d, --dry' , 'Dry run. Does not post' , false )
94
+ . option ( '-v --verbose' , 'Prints additional information to the console' , false )
95
+ . option (
96
+ '-c, --channel <channel>' ,
97
+ 'Channel to post to.' ,
98
+ 'leafygreen-ui-releases' ,
99
+ )
100
+ . action ( releaseBot ) ;
101
+
70
102
/** Lint */
71
103
cli
72
104
. command ( 'lint' )
0 commit comments