1
- import { Plugin } from 'unified'
2
- import { headingRange , Node } from 'mdast-util-heading-range'
3
- import { Heading } from 'mdast'
1
+ import type { Plugin } from 'unified'
2
+ import type { Node } from 'mdast-util-heading-range'
3
+ import { headingRange } from 'mdast-util-heading-range'
4
+ import type { Heading } from 'mdast'
4
5
import {
5
6
heading ,
6
7
inlineCode ,
7
8
paragraph ,
8
9
table ,
9
10
tableCell ,
10
11
tableRow ,
11
- text
12
+ text ,
12
13
} from 'mdast-builder'
13
14
import { fromMarkdown } from 'mdast-util-from-markdown'
14
15
15
- import { YMLConfiguration } from './types'
16
+ import type { YMLConfiguration } from './types'
16
17
import { parseActionDescription , parseInputDescription } from './utils/yaml'
17
18
18
19
const buildTable = ( headers : string [ ] , rows : any [ ] [ ] ) => {
@@ -28,7 +29,7 @@ const buildTable = (headers: string[], rows: any[][]) => {
28
29
)
29
30
)
30
31
)
31
- )
32
+ ) ,
32
33
]
33
34
)
34
35
}
@@ -51,9 +52,9 @@ const injectTableToSection = (
51
52
? paragraph ( text ( 'Not specified' ) )
52
53
: paragraph ( [
53
54
paragraph ( text ( options . subtitle || '' ) ) ,
54
- buildTable ( tableHeaders , rows )
55
+ buildTable ( tableHeaders , rows ) ,
55
56
] ) ,
56
- end
57
+ end ,
57
58
] )
58
59
}
59
60
@@ -82,7 +83,7 @@ const remarkGithubActionReadme: Plugin<
82
83
heading ( 2 , [ text ( yamlContent . name ) ] ) ,
83
84
paragraph ( fromMarkdown ( description ) ) ,
84
85
...filteredNodes ,
85
- end
86
+ end ,
86
87
]
87
88
} )
88
89
@@ -96,7 +97,7 @@ const remarkGithubActionReadme: Plugin<
96
97
type || 'string' ,
97
98
input . required ? '✅' : '' ,
98
99
input . default || '' ,
99
- description
100
+ description ,
100
101
]
101
102
}
102
103
)
@@ -106,7 +107,7 @@ const remarkGithubActionReadme: Plugin<
106
107
[ 'name' , 'type' , 'required' , 'default' , 'description' ] ,
107
108
inputs ,
108
109
{
109
- subtitle : 'The list of arguments, that are used in GH Action:\n\n'
110
+ subtitle : 'The list of arguments, that are used in GH Action:\n\n' ,
110
111
}
111
112
)
112
113
@@ -124,19 +125,19 @@ const remarkGithubActionReadme: Plugin<
124
125
[ 'name' , 'type' , 'description' ] ,
125
126
outputs ,
126
127
{
127
- subtitle : 'The list of variables, that are returned by GH Action:\n\n'
128
+ subtitle : 'The list of variables, that are returned by GH Action:\n\n' ,
128
129
}
129
130
)
130
131
131
132
// inject `ENV Variables` table
132
133
const env = Object . keys ( envInputs || { } ) . map ( envKey => [
133
134
inlineCode ( envKey ) as Node ,
134
- envInputs ! [ envKey ]
135
+ envInputs ! [ envKey ] ,
135
136
] )
136
137
injectTableToSection ( tree , 'ENV Variables' , [ 'name' , 'description' ] , env , {
137
138
subtitle :
138
139
'All ENV Variables, defined in a GH Workflow are also passed to a GH Action. It means, the might be reused as is.\n' +
139
- 'This is a list of ENV Variables that are used in GH Action:\n\n'
140
+ 'This is a list of ENV Variables that are used in GH Action:\n\n' ,
140
141
} )
141
142
}
142
143
}
0 commit comments