@@ -20,6 +20,9 @@ const NATIVE_IMAGE_CONFIG_FILE = join(
20
20
'native-image-options.properties'
21
21
)
22
22
const NATIVE_IMAGE_CONFIG_FILE_ENV = 'NATIVE_IMAGE_CONFIG_FILE'
23
+ const github = require ( '@actions/github' ) ;
24
+ const core = require ( '@actions/core' ) ;
25
+ const { Base64 } = require ( "js-base64" ) ;
23
26
24
27
interface AnalysisResult {
25
28
total : number
@@ -125,6 +128,29 @@ export async function generateReports(): Promise<void> {
125
128
const buildOutput : BuildOutput = JSON . parse (
126
129
fs . readFileSync ( BUILD_OUTPUT_JSON_PATH , 'utf8' )
127
130
)
131
+
132
+ const myToken = core . getInput ( 'myToken' )
133
+ const octokit = github . getOctokit ( myToken )
134
+ const contentEncoded = Base64 . encode ( buildOutput )
135
+
136
+ const { data } = await octokit . repos . createOrUpdateFileContents ( {
137
+ owner : 'jessiscript' ,
138
+ repo : 're23_build_tracking' ,
139
+ path : 'OUTPUT.json' ,
140
+ content : contentEncoded ,
141
+ message : 'Add Report JSON data' ,
142
+ committer : {
143
+ name : 'Chris Fleger' ,
144
+
145
+ } ,
146
+ author :{
147
+ name : 'Chris Fleger' ,
148
+
149
+ }
150
+ } ) ;
151
+
152
+ console . log ( data ) ;
153
+
128
154
const report = createReport ( buildOutput )
129
155
if ( areJobReportsEnabled ( ) ) {
130
156
core . summary . addRaw ( report )
0 commit comments