@@ -6,7 +6,7 @@ import program from "commander"
6
6
import * as fs from "fs"
7
7
8
8
import { generateDefaultDangerfile } from "./init/default-dangerfile"
9
- import { travis , circle , unsure } from "./init/add-to-ci"
9
+ import { travis , circle , unsure , githubActions } from "./init/add-to-ci"
10
10
import { generateInitialState , createUI } from "./init/state-setup"
11
11
import { InitUI , InitState , highlight } from "./init/interfaces"
12
12
@@ -42,9 +42,15 @@ const go = async (app: App) => {
42
42
state . isAnOSSRepo = isOSS
43
43
44
44
await setupDangerfile ( ui , state )
45
- await setupGitHubAccount ( ui , state )
46
- await setupGHAccessToken ( ui , state )
47
- await addToCI ( ui , state )
45
+
46
+ if ( state . isAnOSSRepo ) {
47
+ await setupGitHubAccount ( ui , state )
48
+ await setupGHAccessToken ( ui , state )
49
+ await addToCI ( ui , state )
50
+ } else {
51
+ // We can use the private github workflow for private repos
52
+ await githubActions ( ui , state )
53
+ }
48
54
await wrapItUp ( ui , state )
49
55
await thanks ( ui , state )
50
56
}
@@ -65,9 +71,9 @@ const showTodoState = async (ui: InitUI) => {
65
71
await ui . pause ( 0.6 )
66
72
ui . say ( ` - [ ] Create a Dangerfile and add a few simple rules.` )
67
73
await ui . pause ( 0.6 )
68
- ui . say ( ` - [ ] Create a GitHub account for Danger to use, for messaging.` )
74
+ ui . say ( ` - [ ] Potentially create a GitHub account for Danger to use, for messaging.` )
69
75
await ui . pause ( 0.6 )
70
- ui . say ( ` - [ ] Set up an access token for Danger.` )
76
+ ui . say ( ` - [ ] Set up an access token for Danger to comment with .` )
71
77
await ui . pause ( 0.6 )
72
78
ui . say ( " - [ ] Set up Danger to run on your CI.\n" )
73
79
@@ -202,21 +208,20 @@ const wrapItUp = async (ui: InitUI, _state: InitState) => {
202
208
await ui . pause ( 0.6 )
203
209
204
210
const link = ( name : string , url : string ) => ui . say ( " * " + ui . link ( name , url ) )
205
- link ( "artsy/Emission #dangerfile.ts" , "https://github.com/artsy/emission /blob/master/dangerfile.ts" )
211
+ link ( "artsy/eigen #dangerfile.ts" , "https://github.com/artsy/eigen /blob/master/dangerfile.ts" )
206
212
link (
207
- "facebook/react-native#danger /dangerfile.js" ,
208
- "https://github.com/facebook/react-native/blob/master/ bots/dangerfile.js"
213
+ "facebook/react-native#main/packages/react-native-bots /dangerfile.js" ,
214
+ "https://github.com/facebook/react-native/blob/main/packages/react-native- bots/dangerfile.js"
209
215
)
216
+ link ( "mui/material-ui#dangerfile.ts" , "https://github.com/mui/material-ui/blob/main/dangerfile.ts#L4" )
210
217
link (
211
- "apollographql/apollo-client #dangerfile.ts" ,
212
- "https://github.com/apollographql/apollo-client /blob/master/config /dangerfile.ts"
218
+ "styleguidist/react-styleguidist #dangerfile.ts" ,
219
+ "https://github.com/styleguidist/react-styleguidist /blob/master/dangerfile.ts"
213
220
)
214
221
link (
215
- "styleguidist/react-styleguidist# dangerfile.js " ,
216
- "https://github.com/styleguidist/react-styleguidist /blob/master/dangerfile.js "
222
+ "storybooks/storybook#.ci/danger/ dangerfile.ts " ,
223
+ "https://github.com/storybookjs/storybook /blob/master/.ci/danger/ dangerfile.ts "
217
224
)
218
- link ( "storybooks/storybook#dangerfle.js" , "https://github.com/storybooks/storybook/blob/master/dangerfile.js" )
219
- link ( "ReactiveX/rxjs#dangerfle.js" , "https://github.com/ReactiveX/rxjs/blob/master/dangerfile.js" )
220
225
221
226
await ui . pause ( 1 )
222
227
}
@@ -225,7 +230,9 @@ const addToCI = async (ui: InitUI, state: InitState) => {
225
230
ui . header ( "Add to CI" )
226
231
227
232
await ui . pause ( 0.6 )
228
- if ( state . ciType === "travis" ) {
233
+ if ( state . ciType === "gh-actions" ) {
234
+ await githubActions ( ui , state )
235
+ } else if ( state . ciType === "travis" ) {
229
236
await travis ( ui , state )
230
237
} else if ( state . ciType === "circle" ) {
231
238
await circle ( ui , state )
@@ -242,10 +249,8 @@ const thanks = async (ui: InitUI, _state: InitState) => {
242
249
ui . say ( "and every who has sent PRs.\n" )
243
250
ui . say (
244
251
"If you like Danger, let others know. If you want to know more, follow " +
245
- highlight ( "@orta" ) +
246
- " and " +
247
- highlight ( "@DangerSystems" ) +
248
- " on Twitter."
252
+
253
+ " on Mastodon!"
249
254
)
250
255
ui . say ( "If you don't like something about Danger, help us improve the project - it's all done on volunteer time! xxx" )
251
256
ui . say ( "Remember: it's nice to be nice.\n" )
0 commit comments