Skip to content

Commit 720cd85

Browse files
Jyotsna SinghJosh-01
authored andcommitted
Added dockerfile path to image label
Signed-off-by: Jyotsna Singh <[email protected]>
1 parent 6efc2b0 commit 720cd85

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

dist/index.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as context from './context';
55
import * as exec from './exec';
66
import * as stateHelper from './state-helper';
77
import * as core from '@actions/core';
8+
import * as github from '@actions/github';
89

910
async function run(): Promise<void> {
1011
try {
@@ -23,6 +24,12 @@ async function run(): Promise<void> {
2324
const defContext = context.defaultContext();
2425
let inputs: context.Inputs = await context.getInputs(defContext);
2526

27+
//Add dockerfile path to label
28+
let dockerfilePath = core.getInput('file') || 'Dockerfile';
29+
inputs.labels.push(
30+
`org.opencontainers.image.source=https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/${dockerfilePath}`
31+
);
32+
2633
core.info(`🏃 Starting build...`);
2734
const args: string[] = await context.getArgs(inputs, defContext, buildxVersion);
2835
await exec.exec('docker', args).then(res => {

0 commit comments

Comments
 (0)