Skip to content

Commit c473874

Browse files
authored
Merge pull request #244 from liboz/master
Use default behavior for file flag
2 parents b94cedd + a8587cb commit c473874

File tree

5 files changed

+3
-12
lines changed

5 files changed

+3
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ Following inputs can be used as `step.with` keys
608608
|---------------------|----------|------------------------------------|
609609
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
610610
| `context` | String | Build's context is the set of files located in the specified [`PATH` or `URL`](https://docs.docker.com/engine/reference/commandline/build/) (default [Git context](#git-context)) |
611-
| `file` | String | Path to the Dockerfile (default `./Dockerfile`) |
611+
| `file` | String | Path to the Dockerfile. (default `{context}/Dockerfile`) |
612612
| `build-args` | List | List of build-time variables |
613613
| `labels` | List | List of metadata for an image |
614614
| `tags` | List/CSV | List of tags |

__tests__/context.test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ describe('getArgs', () => {
147147
'buildx',
148148
'build',
149149
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
150-
'--file', 'Dockerfile',
151150
'.'
152151
]
153152
],
@@ -162,7 +161,6 @@ describe('getArgs', () => {
162161
'--build-arg', 'MY_ARG=val1,val2,val3',
163162
'--build-arg', 'ARG=val',
164163
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
165-
'--file', 'Dockerfile',
166164
'https://github.com/docker/build-push-action.git#test-jest'
167165
]
168166
],
@@ -177,7 +175,6 @@ describe('getArgs', () => {
177175
'--tag', 'name/app:7.4',
178176
'--tag', 'name/app:latest',
179177
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
180-
'--file', 'Dockerfile',
181178
'https://github.com/docker/build-push-action.git#test-jest'
182179
]
183180
],
@@ -194,7 +191,6 @@ describe('getArgs', () => {
194191
'--label', 'org.opencontainers.image.title=buildkit',
195192
'--label', 'org.opencontainers.image.description=concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit',
196193
'--output', 'type=local,dest=./release-out',
197-
'--file', 'Dockerfile',
198194
'.'
199195
]
200196
],
@@ -208,7 +204,6 @@ describe('getArgs', () => {
208204
'buildx',
209205
'build',
210206
'--platform', 'linux/amd64,linux/arm64',
211-
'--file', 'Dockerfile',
212207
'.'
213208
]
214209
],
@@ -221,7 +216,6 @@ describe('getArgs', () => {
221216
'buildx',
222217
'build',
223218
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
224-
'--file', 'Dockerfile',
225219
'.'
226220
]
227221
],
@@ -236,7 +230,6 @@ describe('getArgs', () => {
236230
'build',
237231
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
238232
'--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
239-
'--file', 'Dockerfile',
240233
'.'
241234
]
242235
],
@@ -251,7 +244,6 @@ describe('getArgs', () => {
251244
'build',
252245
'--output', '.',
253246
'--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
254-
'--file', 'Dockerfile',
255247
'https://github.com/docker/build-push-action.git#test-jest'
256248
]
257249
],

action.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ inputs:
1616
file:
1717
description: "Path to the Dockerfile"
1818
required: false
19-
default: './Dockerfile'
2019
build-args:
2120
description: "List of build-time variables"
2221
required: false

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string {
5757
export async function getInputs(defaultContext: string): Promise<Inputs> {
5858
return {
5959
context: core.getInput('context') || defaultContext,
60-
file: core.getInput('file') || 'Dockerfile',
60+
file: core.getInput('file'),
6161
buildArgs: await getInputList('build-args', true),
6262
labels: await getInputList('labels', true),
6363
tags: await getInputList('tags'),

0 commit comments

Comments
 (0)