@@ -177,16 +177,22 @@ async function addFileToBranch(projectURL, token, codeJSONObj)
177177 const createFileApiUrl = `https://api.github.com/repos/${ owner } /${ repo } /contents/${ FILE_PATH } ` ;
178178 const encodedContent = btoa ( codeJSONObj ) ;
179179 console . log ( "Content: " , encodedContent ) ;
180+ console . log ( "Branch: " , NEW_BRANCH ) ;
180181
181182 const response = await fetch ( createFileApiUrl ,
182183 {
183184 method : 'PUT' ,
184185 headers : {
185- 'Content-Type' : 'application/json' ,
186- 'Authorization' : 'token' . concat ( token ) ,
186+ 'Accept' : 'application/vnd.github+json' ,
187+ 'Authorization' : 'Bearer ' . concat ( token ) ,
188+ 'X-GitHub-Api-Version' : "2022-11-28"
187189 } ,
188190 body : JSON . stringify ( {
189191 message : "Add codejson to project" ,
192+ committer : {
193+ name : "CodeJSON formsite" ,
194+ email : "opensource@cms.hhs.gov"
195+ } ,
190196 content : encodedContent ,
191197 branch : NEW_BRANCH ,
192198 } ) ,
@@ -217,6 +223,7 @@ async function createPR(projectURL, token)
217223 headers : {
218224 'Content-Type' : 'application/json' ,
219225 'Authorization' : 'token ' . concat ( token ) ,
226+ 'X-GitHub-Api-Version' : "2022-11-28"
220227 } ,
221228 body : JSON . stringify ( {
222229 title : "Add code.json to Project" ,
0 commit comments