mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 17:11:23 +00:00
Output msg if tags input is not provided (#33)
Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
parent
d871ed8ae9
commit
76570bc65b
6 changed files with 13 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
# buildah-build Changelog
|
# buildah-build Changelog
|
||||||
|
|
||||||
## v2.1
|
## v2.1
|
||||||
- Add `archs` input to allow building images for custom architectures. [803a141](https://github.com/redhat-actions/buildah-build/commit/803a1413e7c2a594cbfb6680bca358bfdbe36745)
|
- Add `archs` input to allow building images for custom architectures [803a141](https://github.com/redhat-actions/buildah-build/commit/803a1413e7c2a594cbfb6680bca358bfdbe36745)
|
||||||
|
|
||||||
## v2
|
## v2
|
||||||
- Rename `tag` input to `tags`, to allow you to build multiple tags of the same image
|
- Rename `tag` input to `tags`, to allow you to build multiple tags of the same image
|
||||||
|
|
|
@ -14,7 +14,7 @@ inputs:
|
||||||
default: latest
|
default: latest
|
||||||
base-image:
|
base-image:
|
||||||
description: 'The base image to use to create a new container image'
|
description: 'The base image to use to create a new container image'
|
||||||
required: true
|
required: false
|
||||||
dockerfiles:
|
dockerfiles:
|
||||||
description: 'List of Dockerfile paths (eg: ./Dockerfile)'
|
description: 'List of Dockerfile paths (eg: ./Dockerfile)'
|
||||||
required: false
|
required: false
|
||||||
|
|
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ export enum Inputs {
|
||||||
ARCHS = "archs",
|
ARCHS = "archs",
|
||||||
/**
|
/**
|
||||||
* The base image to use to create a new container image
|
* The base image to use to create a new container image
|
||||||
* Required: true
|
* Required: false
|
||||||
* Default: None.
|
* Default: None.
|
||||||
*/
|
*/
|
||||||
BASE_IMAGE = "base-image",
|
BASE_IMAGE = "base-image",
|
||||||
|
|
|
@ -13,11 +13,18 @@ export async function run(): Promise<void> {
|
||||||
const buildahPath = await io.which("buildah", true);
|
const buildahPath = await io.which("buildah", true);
|
||||||
const cli: BuildahCli = new BuildahCli(buildahPath);
|
const cli: BuildahCli = new BuildahCli(buildahPath);
|
||||||
|
|
||||||
|
const DEFAULT_TAG = "latest";
|
||||||
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
|
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
|
||||||
const dockerFiles = getInputList(Inputs.DOCKERFILES);
|
const dockerFiles = getInputList(Inputs.DOCKERFILES);
|
||||||
const image = core.getInput(Inputs.IMAGE, { required: true });
|
const image = core.getInput(Inputs.IMAGE, { required: true });
|
||||||
const tags = core.getInput(Inputs.TAGS) || "latest";
|
const tags = core.getInput(Inputs.TAGS);
|
||||||
const tagsList: string[] = tags.split(" ");
|
const tagsList: string[] = tags.split(" ");
|
||||||
|
|
||||||
|
// info message if user doesn't provides any tag
|
||||||
|
if (!tagsList.length) {
|
||||||
|
core.info(`Input "${Inputs.TAGS}" is not provided, using default tag "${DEFAULT_TAG}"`);
|
||||||
|
tagsList.push(DEFAULT_TAG);
|
||||||
|
}
|
||||||
const newImage = `${image}:${tagsList[0]}`;
|
const newImage = `${image}:${tagsList[0]}`;
|
||||||
const useOCI = core.getInput(Inputs.OCI) === "true";
|
const useOCI = core.getInput(Inputs.OCI) === "true";
|
||||||
let archs: string | undefined = core.getInput(Inputs.ARCHS);
|
let archs: string | undefined = core.getInput(Inputs.ARCHS);
|
||||||
|
|
Loading…
Reference in a new issue