@@ -69,15 +69,19 @@ export async function pathIsDirectory(path) {
6969 return stat . isDirectory ( )
7070}
7171
72- export async function write ( src , dest , context ) {
72+ export async function write ( src , dest , context , item ) {
7373 if ( typeof context !== 'object' ) {
7474 context = { }
7575 }
76+
77+ // include current repo constants (e.g., host, user, name, branch, etc.)
78+ context . repo = item . repo
79+
7680 const content = nunjucks . render ( src , context )
7781 await fs . outputFile ( dest , content )
7882}
7983
80- export async function copy ( src , dest , isDirectory , file ) {
84+ export async function copy ( src , dest , isDirectory , file , item ) {
8185 const deleteOrphaned = isDirectory && file . deleteOrphaned
8286 const exclude = file . exclude
8387
@@ -121,12 +125,12 @@ export async function copy(src, dest, isDirectory, file) {
121125
122126 const srcPath = path . join ( src , srcFile )
123127 const destPath = path . join ( dest , srcFile )
124- await write ( srcPath , destPath , file . template )
128+ await write ( srcPath , destPath , file . template , item )
125129 }
126130 } else {
127131 core . debug ( `Render file ${ src } to ${ dest } ` )
128132
129- await write ( src , dest , file . template )
133+ await write ( src , dest , file . template , item )
130134 }
131135 } else {
132136 core . debug ( `Copy ${ src } to ${ dest } ` )
@@ -166,4 +170,4 @@ export async function remove(src) {
166170
167171export function arrayEquals ( array1 , array2 ) {
168172 return Array . isArray ( array1 ) && Array . isArray ( array2 ) && array1 . length === array2 . length && array1 . every ( ( value , i ) => value === array2 [ i ] )
169- }
173+ }
0 commit comments