Resolve reviews

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
divyansh42 2021-09-13 17:26:39 +05:30
parent 2f2d1a7280
commit 687dc7101f
4 changed files with 14 additions and 11 deletions

View file

@ -28,12 +28,13 @@ After building your image, use [push-to-registry](https://github.com/redhat-acti
| arch | Label the image with this architecture, instead of defaulting to the host architecture. Refer to [Multi arch builds](#multi-arch-builds) for more information. | None (host architecture) | arch | Label the image with this architecture, instead of defaulting to the host architecture. Refer to [Multi arch builds](#multi-arch-builds) for more information. | None (host architecture)
| build-args | Build arguments to pass to the Docker build using `--build-arg`, if using a Containerfile that requires ARGs. Use the form `arg_name=arg_value`, and separate arguments with newlines. | None | build-args | Build arguments to pass to the Docker build using `--build-arg`, if using a Containerfile that requires ARGs. Use the form `arg_name=arg_value`, and separate arguments with newlines. | None
| context | Path to directory to use as the build context. | `.` | context | Path to directory to use as the build context. | `.`
| containerfiles | The list of Containerfile paths to perform a build using docker instructions. This is a multiline input to allow multiple Containerfiles. | **Must be provided** | containerfiles* | The list of Containerfile paths to perform a build using docker instructions. This is a multiline input to allow multiple Containerfiles. | **Must be provided**
| extra-args | Extra args to be passed to buildah bud. Separate arguments by newline. Do not use quotes. | None | extra-args | Extra args to be passed to buildah bud. Separate arguments by newline. Do not use quotes. | None
| image | Name to give to the output image. | **Must be provided** | image | Name to give to the output image. | **Must be provided**
| layers | Set to true to cache intermediate layers during the build process. | None | layers | Set to true to cache intermediate layers during the build process. | None
| oci | Build the image using the OCI format, instead of the Docker format. By default, this is `false`, because images built using the OCI format have issues when published to Dockerhub. | `false` | oci | Build the image using the OCI format, instead of the Docker format. By default, this is `false`, because images built using the OCI format have issues when published to Dockerhub. | `false`
| tags | The tags of the image to build. For multiple tags, separate by a space. For example, `latest ${{ github.sha }}` | `latest` | tags | The tags of the image to build. For multiple tags, separate by a space. For example, `latest ${{ github.sha }}` | `latest`
> *Input `containerfiles` was previously `dockerfiles`. Now input `dockerfiles` is supported alias of `containerfiles`. For details see the [linked issue](https://github.com/redhat-actions/buildah-build/issues/57).
<a id="scratch-build-inputs"></a> <a id="scratch-build-inputs"></a>

4
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -72,8 +72,9 @@ export function getArch(): string {
if (arch && archs) { if (arch && archs) {
core.warning( core.warning(
`Please use only one input of "${Inputs.ARCH}" and "${Inputs.ARCHS}". "${Inputs.ARCH}" takes precedence, ` `Both "${Inputs.ARCH}" and "${Inputs.ARCHS}" inputs are set. `
+ `so --arch argument will be "${arch}".` + `Please use only one of these two inputs, as they are aliases of one another. `
+ `"${Inputs.ARCH}" takes precedence.`
); );
} }
@ -88,8 +89,9 @@ export function getContainerfiles(): string[] {
if (containerfiles.length !== 0 && dockerfiles.length !== 0) { if (containerfiles.length !== 0 && dockerfiles.length !== 0) {
core.warning( core.warning(
`Please use only one input of "${Inputs.CONTAINERFILES}" and "${Inputs.DOCKERFILES}". ` `Both "${Inputs.CONTAINERFILES}" and "${Inputs.DOCKERFILES}" inputs are set. `
+ `"${Inputs.CONTAINERFILES}" takes precedence, ` + `Please use only one of these two inputs, as they are aliases of one another. `
+ `"${Inputs.CONTAINERFILES}" takes precedence.`
); );
} }
@ -101,11 +103,11 @@ export function getInputList(name: string): string[] {
if (!items) { if (!items) {
return []; return [];
} }
return items const splitItems = splitByNewline(items);
.split(/\r?\n/) return splitItems
.filter((x) => x) .filter((x) => x)
.reduce<string[]>( .reduce<string[]>(
(acc, line) => acc.concat(line).map((pat) => pat.trim()), (acc, line) => acc.concat(line).map((item) => item.trim()),
[], [],
); );
} }