File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string {
5454}
5555
5656export async function getInputs ( defaultContext : string ) : Promise < Inputs > {
57- return {
57+
58+ let userInputs = {
5859 context : core . getInput ( 'context' ) || defaultContext ,
5960 file : core . getInput ( 'file' ) || 'Dockerfile' ,
6061 buildArgs : await getInputList ( 'build-args' , true ) ,
@@ -75,6 +76,20 @@ export async function getInputs(defaultContext: string): Promise<Inputs> {
7576 githubToken : core . getInput ( 'github-token' ) ,
7677 ssh : await getInputList ( 'ssh' )
7778 } ;
79+
80+ //Add repo as source-label if not already supplied by user
81+ const sourceLabelKey = 'org.opencontainers.image.source' ;
82+ if ( userInputs . labels . find ( val => val . startsWith ( sourceLabelKey ) == true ) == null ) {
83+ userInputs . labels . push (
84+ `${ sourceLabelKey } =https://github.com/${ github . context . repo . owner } /${ github . context . repo . repo } `
85+ ) ;
86+ }
87+
88+ //Add dockerfile path as label
89+ let dockerfilePath = userInputs . file ;
90+ userInputs . labels . push ( `dockerfile-path=${ dockerfilePath } ` ) ;
91+
92+ return userInputs ;
7893}
7994
8095export async function getArgs ( inputs : Inputs , defaultContext : string , buildxVersion : string ) : Promise < Array < string > > {
You can’t perform that action at this time.
0 commit comments