@@ -10,12 +10,14 @@ const dec = new TextDecoder()
1010
1111async function main ( ) {
1212 const token = core . getInput ( 'token' )
13+ const tokenCommon = core . getInput ( 'tokenCommon' )
1314 const inputCovPath = core . getInput ( 'coverageResultsPath' ) // 'data/coverage-raw.json'
1415 const outputCovPath = core . getInput ( 'coverageResultsPath' ) // 'data/coverage.json'
1516 const outputHistPath = core . getInput ( 'histCoveragePath' ) // 'data/historical-coverage.json'
1617 const relVersionRaw = core . getInput ( 'version' ) // 'v7.47.0'
1718 const relVersion = relVersionRaw . indexOf ( 'v' ) === 0 ? relVersionRaw . substring ( 1 ) : relVersionRaw
1819 const gh = github . getOctokit ( token )
20+ const ghCommon = github . getOctokit ( tokenCommon )
1921 const owner = github . context . repo . owner // 'ietf-tools'
2022 const repo = github . context . repo . repo // 'datatracker'
2123 const sender = github . context . payload . sender . login // 'rjsparks'
@@ -58,7 +60,6 @@ async function main () {
5860 releases . push ( ...resp . data )
5961 }
6062 } while ( hasMoreReleases )
61- console . info ( releases [ 0 ] )
6263 console . info ( `Found ${ releases . length } existing releases.` )
6364
6465 // -> Fetch latest historical coverage
@@ -95,7 +96,7 @@ async function main () {
9596 }
9697
9798 // -> Find matching release version
98- const newRelease = find ( releases , [ 'name' , 'v7.46.0' ] ) // relVersionRaw
99+ const newRelease = find ( releases , [ 'name' , relVersionRaw ] )
99100 if ( ! newRelease ) {
100101 console . warn ( `Could not find a release matching ${ relVersionRaw } ... Skipping coverage chart generation...` )
101102 return
@@ -126,7 +127,7 @@ async function main () {
126127 const datasetCode = [ ]
127128 const datasetTemplate = [ ]
128129 const datasetUrl = [ ]
129- for ( const [ key , value ] of Object . entries ( covData ) ) {
130+ for ( const [ key , value ] of Object . entries ( covData ) . sort ( ( a , b ) => a [ 0 ] . localeCompare ( b [ 0 ] ) ) ) {
130131 labels . push ( key )
131132 datasetCode . push ( round ( value . code * 100 , 2 ) )
132133 datasetTemplate . push ( round ( value . template * 100 , 2 ) )
@@ -212,7 +213,7 @@ async function main () {
212213 const svg = Buffer . from ( outputStream ) . toString ( 'base64' )
213214
214215 console . info ( `Uploading chart SVG for ${ newRelease . name } ...` )
215- await gh . rest . repos . createOrUpdateFileContents ( {
216+ await ghCommon . rest . repos . createOrUpdateFileContents ( {
216217 owner,
217218 repo : repoCommon ,
218219 path : `assets/graphs/datatracker/${ newRelease . id } .svg` ,
@@ -240,7 +241,7 @@ async function main () {
240241 formattedBody += ` } ?style=flat-square)\n\n`
241242 formattedBody += ``
242243
243- core . exportVariable ( 'changelog' , formattedBody )
244+ core . setOutput ( 'changelog' , formattedBody )
244245}
245246
246247main ( )
0 commit comments