@@ -876,9 +876,10 @@ function renderRunSummary(run, headingLevel = 2, opts = {}) {
876876function generateTraceSummary ( trace , opts = { } ) {
877877 const warnings = collectTraceQualityWarnings ( trace )
878878 const warningLines = renderQualityWarnings ( warnings )
879+ const artifactLines = renderArtifactLink ( )
879880
880881 if ( trace . runs . length === 1 ) {
881- return [ renderRunSummary ( trace . runs [ 0 ] , 2 , opts ) , ...warningLines ] . join ( '\n' ) . trimEnd ( )
882+ return [ renderRunSummary ( trace . runs [ 0 ] , 2 , opts ) , ...warningLines , ... artifactLines ] . join ( '\n' ) . trimEnd ( )
882883 }
883884
884885 const lines = [
@@ -900,9 +901,25 @@ function generateTraceSummary(trace, opts = {}) {
900901 }
901902
902903 lines . push ( ...warningLines )
904+ lines . push ( ...artifactLines )
903905 return lines . join ( '\n' ) . trimEnd ( )
904906}
905907
908+ function renderArtifactLink ( ) {
909+ const serverUrl = process . env . GITHUB_SERVER_URL || 'https://github.com'
910+ const repo = process . env . GITHUB_REPOSITORY
911+ const runId = process . env . GITHUB_RUN_ID
912+
913+ if ( ! repo || ! runId ) return [ ]
914+
915+ const url = `${ serverUrl } /${ repo } /actions/runs/${ runId } `
916+ return [
917+ '' ,
918+ `Trace artifact: [GitHub Actions run](${ url } )` ,
919+ '' ,
920+ ]
921+ }
922+
906923function renderQualityWarnings ( warnings ) {
907924 if ( warnings . length === 0 ) return [ ]
908925
0 commit comments