Skip to content

Commit a6389b6

Browse files
committed
feat: Add container-context input to workflows for flexible build context
1 parent 5ad8489 commit a6389b6

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/container-publish.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
type: string
1414
default: "Dockerfile"
1515

16+
container-context:
17+
description: "Build's context is the set of files located in the specified PATH or URL"
18+
type: string
19+
default: "."
20+
1621
container-name:
1722
description: "Name of the container"
1823
type: string
@@ -71,7 +76,7 @@ jobs:
7176
id: build
7277
with:
7378
file: "${{ inputs.container-file }}"
74-
context: .
79+
context: "${{ inputs.container-context }}"
7580
push: true
7681
tags: ${{ steps.meta.outputs.tags }}
7782
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/container-security.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
type: string
1313
default: "Dockerfile"
1414

15+
container-context:
16+
description: "Build's context is the set of files located in the specified PATH or URL"
17+
type: string
18+
default: "."
19+
1520
container-name:
1621
description: "Name of the container"
1722
type: string
@@ -45,7 +50,7 @@ jobs:
4550
id: build
4651
with:
4752
file: "${{ inputs.container-file }}"
48-
context: .
53+
context: "${{ inputs.container-context }}"
4954
load: true
5055
push: false
5156
tags: localbuild/testimage:latest

.github/workflows/container.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
type: string
1313
default: "Dockerfile"
1414

15+
container-context:
16+
description: "Build's context is the set of files located in the specified PATH or URL"
17+
type: string
18+
default: "."
19+
1520
container-name:
1621
description: "Name of the container"
1722
type: string
@@ -101,6 +106,7 @@ jobs:
101106
with:
102107
version: ${{ needs.set-version.outputs.version }}
103108
container-file: ${{ inputs.container-file }}
109+
container-context: ${{ inputs.container-context }}
104110
container-name: ${{ inputs.container-name }}
105111
scanning-block: ${{ inputs.scanning-block }}
106112

@@ -117,5 +123,6 @@ jobs:
117123
with:
118124
version: ${{ needs.set-version.outputs.version }}
119125
container-file: ${{ inputs.container-file }}
126+
container-context: ${{ inputs.container-context }}
120127
container-name: ${{ inputs.container-name }}
121128
sbom: ${{ inputs.sbom }}

0 commit comments

Comments
 (0)