@@ -3954,12 +3954,10 @@ async function run() {
39543954 try {
39553955 const build_context = core . getInput ( "build_context" ) ;
39563956 const extra_tree_objects = core . getMultilineInput ( "extra_tree_objects" ) ;
3957- const extra_values = core . getMultilineInput ( "extra_values" ) ;
39583957
3959- core . startGroup ( `Input ` ) ;
3958+ core . startGroup ( `Parsed config values ` ) ;
39603959 core . info ( build_context ) ;
39613960 core . info ( extra_tree_objects ) ;
3962- core . info ( extra_values ) ;
39633961 core . endGroup ( ) ;
39643962
39653963 await core . group ( `Build context image` , async ( ) => {
@@ -3995,12 +3993,10 @@ async function run() {
39953993 core . startGroup ( `Collect all file object names from git tree` ) ;
39963994 const tree_object_paths = image_context . split ( "\n" ) ;
39973995 tree_object_paths . push ( ...extra_tree_objects ) ;
3998- // TODO: If we format `%(path)` as well, there's no need for the follow up
3999- // `hash-object` of filenames below, right?
40003996 const ls_tree_cmd = [
40013997 "ls-tree" ,
40023998 "-r" ,
4003- "--format=%(objectname)" ,
3999+ "--format=%(objectname) %(path) " ,
40044000 "--full-tree" ,
40054001 "HEAD" ,
40064002 ] ;
@@ -4010,41 +4006,10 @@ async function run() {
40104006 } ) ;
40114007 core . endGroup ( ) ;
40124008
4013- if (
4014- tree_object_names . stdout . trim ( ) . split ( "\n" ) . length !==
4015- tree_object_paths . length
4016- ) {
4017- core . setFailed (
4018- `Object paths did not match the intended amount of objects in the tree (${
4019- tree_object_names . stdout . trim ( ) . split ( "\n" ) . length
4020- } != ${ tree_object_paths . length } )`
4021- ) ;
4022- return ;
4023- }
4024-
4025- core . startGroup ( `Generate filenames hash` ) ;
4026- const filenames = image_context . split ( "\n" ) ;
4027- filenames . push ( ...extra_values ) ;
4028- core . info ( filenames . join ( "\n" ) ) ;
4029- const filenames_hashes = await exec . getExecOutput (
4030- "git" ,
4031- [ "hash-object" , "--stdin" ] ,
4032- {
4033- failOnStdErr : true ,
4034- input : Buffer . from ( filenames . join ( "\n" ) , "utf-8" ) ,
4035- }
4036- ) ;
4037- core . endGroup ( ) ;
4038-
4039- core . startGroup ( `Generate hash from filenames and git tree object names` ) ;
4009+ core . startGroup ( `Generate hash from git tree objects` ) ;
40404010 const hash = await exec . getExecOutput ( "git" , [ "hash-object" , "--stdin" ] , {
40414011 failOnStdErr : true ,
4042- input : Buffer . from (
4043- // Only trim "prefixing" part before join, so that the resulting line has a
4044- // newline as suffix.
4045- [ tree_object_names . stdout . trim ( ) , filenames_hashes . stdout ] . join ( "\n" ) ,
4046- "utf-8"
4047- ) ,
4012+ input : Buffer . from ( tree_object_names . stdout , "utf-8" ) ,
40484013 } ) ;
40494014 core . endGroup ( ) ;
40504015
0 commit comments