@@ -6,7 +6,7 @@ import Stainless from "@stainless-api/sdk";
66
77// https://www.conventionalcommits.org/en/v1.0.0/
88const CONVENTIONAL_COMMIT_REGEX = new RegExp (
9- / ^ ( b u i l d | c h o r e | c i | d o c s | f e a t | f i x | p e r f | r e f a c t o r | r e v e r t | s t y l e | t e s t ) ( \( .* \) ) ? ( ! ? ) : .* $ /
9+ / ^ ( b u i l d | c h o r e | c i | d o c s | f e a t | f i x | p e r f | r e f a c t o r | r e v e r t | s t y l e | t e s t ) ( \( .* \) ) ? ( ! ? ) : .* $ / ,
1010) ;
1111
1212export const isValidConventionalCommitMessage = ( message : string ) => {
@@ -43,7 +43,7 @@ function getInputValue(name: string, options?: { required: boolean }): string {
4343// Get boolean input values from either GitHub Actions or GitLab CI environment
4444function getBooleanInputValue (
4545 name : string ,
46- options ?: { required : boolean }
46+ options ?: { required : boolean } ,
4747) : boolean {
4848 if ( isGitLabCI ( ) ) {
4949 // Try GitLab-specific INPUT_ prefixed variable first (like GitHub Actions)
@@ -102,13 +102,15 @@ export async function main() {
102102 projectName = projects . data [ 0 ] ! . slug ;
103103 if ( projects . data . length > 1 ) {
104104 warn (
105- `Multiple projects found. Using ${ projectName } as default, but we recommend specifying the project name in the inputs.`
105+ `Multiple projects found. Using ${ projectName } as default, but we recommend specifying the project name in the inputs.` ,
106106 ) ;
107107 }
108108 }
109109
110110 info (
111- configPath ? "Uploading spec and config files..." : "Uploading spec file..."
111+ configPath
112+ ? "Uploading spec and config files..."
113+ : "Uploading spec file..." ,
112114 ) ;
113115 const response = await uploadSpecAndConfig (
114116 inputPath ,
@@ -117,11 +119,11 @@ export async function main() {
117119 projectName ,
118120 commitMessage ,
119121 guessConfig ,
120- branch
122+ branch ,
121123 ) ;
122124 if ( ! response . ok ) {
123125 const errorMsg = `Build failed with the following outcomes: ${ JSON . stringify (
124- response . errors
126+ response . errors ,
125127 ) } See more details in the Stainless Studio.`;
126128 error ( errorMsg ) ;
127129 throw Error ( errorMsg ) ;
@@ -139,7 +141,7 @@ export async function main() {
139141 response . decoratedSpec = JSON . stringify (
140142 YAML . parse ( response . decoratedSpec ) ,
141143 null ,
142- 2
144+ 2 ,
143145 ) ;
144146 }
145147 writeFileSync ( outputPath , response . decoratedSpec ) ;
@@ -154,7 +156,7 @@ async function uploadSpecAndConfig(
154156 projectName : string ,
155157 commitMessage : string ,
156158 guessConfig : boolean ,
157- branch : string
159+ branch : string ,
158160) : Promise < {
159161 ok : boolean ;
160162 errors : Array < {
@@ -173,7 +175,7 @@ async function uploadSpecAndConfig(
173175 await stainless . projects . configs . guess ( {
174176 branch,
175177 spec : specContent ,
176- } )
178+ } ) ,
177179 ) [ 0 ] ?. content ;
178180 } else if ( configPath ) {
179181 configContent = readFileSync ( configPath , "utf8" ) ;
@@ -198,7 +200,7 @@ async function uploadSpecAndConfig(
198200 } ,
199201 allow_empty : true ,
200202 } ,
201- { headers }
203+ { headers } ,
202204 ) ;
203205
204206 const pollingStart = Date . now ( ) ;
@@ -207,7 +209,7 @@ async function uploadSpecAndConfig(
207209 build = await stainless . builds . retrieve ( build . id ) ;
208210 donePolling = Object . values ( build . targets ) . every (
209211 ( target ) =>
210- ( target as Stainless . BuildTarget ) . commit . status === "completed"
212+ ( target as Stainless . BuildTarget ) . commit . status === "completed" ,
211213 ) ;
212214 if ( ! donePolling ) {
213215 await new Promise ( ( resolve ) => setTimeout ( resolve , 5 * 1000 ) ) ;
@@ -217,7 +219,7 @@ async function uploadSpecAndConfig(
217219 const errors = (
218220 Object . entries ( build . targets ) as [
219221 keyof Stainless . BuildObject . Targets ,
220- Stainless . BuildTarget
222+ Stainless . BuildTarget ,
221223 ] [ ]
222224 )
223225 . map ( ( [ target , value ] ) => {
@@ -226,7 +228,7 @@ async function uploadSpecAndConfig(
226228 // all be considered failures.
227229 value . commit ?. status === "completed" &&
228230 [ "noop" , "error" , "warning" , "note" , "success" ] . includes (
229- value . commit . completed . conclusion
231+ value . commit . completed . conclusion ,
230232 )
231233 ) {
232234 return undefined ;
0 commit comments