@@ -13,6 +13,7 @@ async function run(): Promise<void> {
1313 const path = core . getInput ( Inputs . Path , { required : true } )
1414 const name = core . getInput ( Inputs . Name )
1515 const title = core . getInput ( Inputs . Title )
16+ const commit = core . getInput ( Inputs . Commit )
1617
1718 const searchResult = await findResults ( path )
1819 if ( searchResult . filesToUpload . length === 0 ) {
@@ -45,6 +46,7 @@ async function run(): Promise<void> {
4546 for ( const annotationSet of groupedAnnotations ) {
4647 await createCheck (
4748 name ,
49+ commit ,
4850 title ,
4951 annotationSet ,
5052 annotations . length ,
@@ -86,6 +88,7 @@ function getConclusion(
8688
8789async function createCheck (
8890 name : string ,
91+ commit : string ,
8992 title : string ,
9093 annotations : Annotation [ ] ,
9194 numErrors : number ,
@@ -95,15 +98,13 @@ async function createCheck(
9598 `Uploading ${ annotations . length } / ${ numErrors } annotations to GitHub as ${ name } with conclusion ${ conclusion } `
9699 )
97100 const octokit = getOctokit ( core . getInput ( Inputs . Token ) )
98- let sha = context . sha
99-
100- if ( context . payload . pull_request ) {
101- sha = context . payload . pull_request . head . sha
102- }
101+ const head_sha = commit ||
102+ ( context . payload . pull_request && context . payload . pull_request . head . sha ) ||
103+ context . sha ;
103104
104105 const req = {
105106 ...context . repo ,
106- ref : sha
107+ ref : head_sha
107108 }
108109
109110 const res = await octokit . checks . listForRef ( req )
@@ -114,7 +115,7 @@ async function createCheck(
114115 if ( ! existingCheckRun ) {
115116 const createRequest = {
116117 ...context . repo ,
117- head_sha : sha ,
118+ head_sha,
118119 conclusion,
119120 name,
120121 status : < const > 'completed' ,
0 commit comments