Skip to content

Commit

Permalink
Output msg if tags input is not provided (#33)
Browse files Browse the repository at this point in the history
Signed-off-by: divyansh42 <[email protected]>
  • Loading branch information
divyansh42 committed Feb 24, 2021
1 parent d871ed8 commit 76570bc
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# buildah-build Changelog

## 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
- Rename `tag` input to `tags`, to allow you to build multiple tags of the same image
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
default: latest
base-image:
description: 'The base image to use to create a new container image'
required: true
required: false
dockerfiles:
description: 'List of Dockerfile paths (eg: ./Dockerfile)'
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/generated/inputs-outputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export enum Inputs {
ARCHS = "archs",
/**
* The base image to use to create a new container image
* Required: true
* Required: false
* Default: None.
*/
BASE_IMAGE = "base-image",
Expand Down
9 changes: 8 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ export async function run(): Promise<void> {
const buildahPath = await io.which("buildah", true);
const cli: BuildahCli = new BuildahCli(buildahPath);

const DEFAULT_TAG = "latest";
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
const dockerFiles = getInputList(Inputs.DOCKERFILES);
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(" ");

// 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 useOCI = core.getInput(Inputs.OCI) === "true";
let archs: string | undefined = core.getInput(Inputs.ARCHS);
Expand Down

0 comments on commit 76570bc

Please sign in to comment.