@@ -737,6 +737,45 @@ function main(): void {
737737
738738 console . log ( `Found ${ checkFiles . length } check specification(s).` ) ;
739739
740+ let allInputs : Record < string , WorkflowInput > = { } ;
741+
742+ const initialChecksJob = workflowCall ( "Initial checks" , "pr-checks" ) ;
743+
744+ const cron = new yaml . Scalar ( "0 5 * * *" ) ;
745+ cron . type = yaml . Scalar . QUOTE_SINGLE ;
746+
747+ const checkWorkflow = {
748+ name : `PR Checks` ,
749+ env : {
750+ GITHUB_TOKEN : "${{ secrets.GITHUB_TOKEN }}" ,
751+ GO111MODULE : "auto" ,
752+ } ,
753+ on : {
754+ push : {
755+ branches : [ "main" , "releases/v*" ] ,
756+ } ,
757+ pull_request : { } ,
758+ merge_group : {
759+ types : [ "checks_requested" ] ,
760+ } ,
761+ schedule : [ { cron } ] ,
762+ workflow_dispatch : {
763+ inputs : { } ,
764+ } ,
765+ workflow_call : {
766+ inputs : { } ,
767+ } ,
768+ } ,
769+ defaults : {
770+ run : {
771+ shell : "bash" ,
772+ } ,
773+ } ,
774+ jobs : {
775+ "pr-checks" : initialChecksJob ,
776+ } ,
777+ } ;
778+
740779 const collections : Record <
741780 string ,
742781 Array < {
@@ -781,9 +820,6 @@ function main(): void {
781820 extraGroupName += `-\${{inputs.${ inputName } }}` ;
782821 }
783822
784- const cron = new yaml . Scalar ( "0 5 * * *" ) ;
785- cron . type = yaml . Scalar . QUOTE_SINGLE ;
786-
787823 const workflow = {
788824 name : `PR Check - ${ checkSpecification . name } ` ,
789825 env : {
@@ -826,6 +862,12 @@ function main(): void {
826862 writeYaml ( outputPath , workflow ) ;
827863 }
828864
865+ checkWorkflow . on . workflow_call . inputs = allInputs ;
866+ checkWorkflow . on . workflow_dispatch . inputs = allInputs ;
867+
868+ const mainOutputPath = path . join ( OUTPUT_DIR , `__pr.yml` ) ;
869+ writeYaml ( mainOutputPath , checkWorkflow ) ;
870+
829871 // Write workflow files for collections.
830872 for ( const collectionName of Object . keys ( collections ) ) {
831873 const jobs : Record < string , any > = { } ;
0 commit comments