@@ -722,11 +722,35 @@ describe("GitHub check failures", () => {
722722 check_run_url : "https://api.github.com/repos/acme/web/check-runs/123" ,
723723 steps : [ { name : "Run lint" , conclusion : "failure" } ] ,
724724 } ;
725+ const exitOneAnnotation = {
726+ path : ".github" ,
727+ start_line : 0 ,
728+ annotation_level : "failure" ,
729+ message : "Process completed with exit code 1." ,
730+ } ;
725731
726732 it . effect ( "sees the signed log redirect itself and follows it without Authorization" , ( ) => {
727733 const { layer, calls, fetch } = fetchHarness ( ( url ) => {
728734 if ( url . includes ( "/annotations" ) )
729735 return json ( [
736+ {
737+ path : ".github" ,
738+ start_line : 0 ,
739+ annotation_level : "failure" ,
740+ message : "Process completed with exit code 1." ,
741+ } ,
742+ {
743+ path : ".github" ,
744+ start_line : 0 ,
745+ annotation_level : "failure" ,
746+ message : "Process completed with exit code 137." ,
747+ } ,
748+ {
749+ path : ".github/workflows/ci.yml" ,
750+ start_line : 0 ,
751+ annotation_level : "failure" ,
752+ message : "Process completed with exit code 1." ,
753+ } ,
730754 { path : "a.ts" , start_line : 4 , annotation_level : "failure" , message : "bad code" } ,
731755 { path : "budget.json" , start_line : 0 , annotation_level : "failure" , message : "grew" } ,
732756 ] ) ;
@@ -736,7 +760,9 @@ describe("GitHub check failures", () => {
736760 headers : { location : "https://blob.example/log?signature=secret" } ,
737761 } ) ;
738762 if ( url . startsWith ( "https://blob.example/" ) )
739- return new Response ( "2026-10-30T12:00:00Z ##[error]bad code\n" ) ;
763+ return new Response (
764+ "2026-10-30T12:00:00Z ##[error]bad code\n##[error]Process completed with exit code 1.\n" ,
765+ ) ;
740766 return json ( job ) ;
741767 } ) ;
742768 return Effect . gen ( function * ( ) {
@@ -746,10 +772,16 @@ describe("GitHub check failures", () => {
746772 attempt : 1 ,
747773 failedSteps : [ "Run lint" ] ,
748774 annotations : [
775+ { path : ".github" , startLine : 0 , message : "Process completed with exit code 137." } ,
749776 { path : "a.ts" , startLine : 4 , message : "bad code" } ,
750777 { path : "budget.json" , startLine : 0 , message : "grew" } ,
751778 ] ,
752- log : { _tag : "excerpt" , text : "##[error]bad code" , totalLines : 1 , truncated : false } ,
779+ log : {
780+ _tag : "excerpt" ,
781+ text : "##[error]bad code\n##[error]Process completed with exit code 1." ,
782+ totalLines : 2 ,
783+ truncated : false ,
784+ } ,
753785 } ) ;
754786 expect ( result ) . not . toHaveProperty ( "required" ) ;
755787 const authorization = ( call : ( typeof calls ) [ number ] ) =>
@@ -770,7 +802,7 @@ describe("GitHub check failures", () => {
770802 it . effect ( "reads an untouched job from an earlier attempt after a rerun" , ( ) => {
771803 const { layer } = harness ( ( request ) =>
772804 request . url . includes ( "/annotations" )
773- ? json ( [ ] )
805+ ? json ( [ exitOneAnnotation ] )
774806 : request . url . endsWith ( "/logs" )
775807 ? new Response ( "##[error]bad code\n" )
776808 : json ( job ) ,
@@ -783,6 +815,9 @@ describe("GitHub check failures", () => {
783815 } ) ;
784816 expect ( result ) . toMatchObject ( {
785817 attempt : 1 ,
818+ annotations : [
819+ { path : ".github" , startLine : 0 , message : "Process completed with exit code 1." } ,
820+ ] ,
786821 log : { _tag : "excerpt" , text : "##[error]bad code" } ,
787822 } ) ;
788823 } ) . pipe ( Effect . provide ( layer ) ) ;
@@ -816,14 +851,27 @@ describe("GitHub check failures", () => {
816851 ] ) ( "returns $reason for $name without extra reads" , ( test ) => {
817852 const { layer, requests } = harness ( ( request ) =>
818853 request . url . includes ( "/annotations" )
819- ? json ( [ ] )
854+ ? json ( [ exitOneAnnotation ] )
820855 : request . url . endsWith ( "/logs" )
821856 ? json ( { message : "Unavailable" } , { status : test . logStatus } )
822857 : json ( test . job ) ,
823858 ) ;
824859 return Effect . gen ( function * ( ) {
825860 const read = yield * makeGitHubCheckFailureReader ;
826- expect ( ( yield * read ( input ) ) . log ) . toEqual ( { _tag : "unavailable" , reason : test . reason } ) ;
861+ const result = yield * read ( input ) ;
862+ expect ( result . log ) . toEqual ( { _tag : "unavailable" , reason : test . reason } ) ;
863+ expect ( result . annotations ) . toEqual (
864+ test . requests === 3
865+ ? [
866+ {
867+ path : ".github" ,
868+ startLine : 0 ,
869+ level : "failure" ,
870+ message : exitOneAnnotation . message ,
871+ } ,
872+ ]
873+ : [ ] ,
874+ ) ;
827875 expect ( requests ) . toHaveLength ( test . requests ) ;
828876 } ) . pipe ( Effect . provide ( layer ) ) ;
829877 } ) ;
0 commit comments