File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as core from "@actions/core" ;
22import { CodeJSON } from "./model.js" ;
33import * as helpers from "./helper.js" ;
4+ import { stripOutdatedFields } from "./validation.js" ;
45
56const baselineCodeJSON : CodeJSON = {
67 name : "" ,
@@ -159,6 +160,8 @@ export async function run(): Promise<void> {
159160 } ;
160161 }
161162
163+ finalCodeJSON = stripOutdatedFields ( finalCodeJSON )
164+
162165 core . info ( "Generated code.json successfully!" ) ;
163166
164167 const baseBranchName = await helpers . getBaseBranch ( ) ;
Original file line number Diff line number Diff line change @@ -127,3 +127,11 @@ export function validateCodeJSON(codeJSON: any): string[] {
127127 return `${ field } : ${ err . message } ` ;
128128 } ) ;
129129}
130+
131+ export function stripOutdatedFields ( codeJSON : any ) : any {
132+ try {
133+ return CodeJSONSchema . loose ( ) . parse ( codeJSON )
134+ } catch ( error ) {
135+ return codeJSON
136+ }
137+ }
You can’t perform that action at this time.
0 commit comments