Skip to content

Commit

Permalink
[0.3.1] Make inputs and images not required (for deprecations bac…
Browse files Browse the repository at this point in the history
…k in 0.3), add issue #131 in readme
  • Loading branch information
auguwu committed Jan 27, 2023
1 parent acf2524 commit c58b0f6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Comma-seperated list of images that will be applied in the merged manifest from
#### Example

```yaml
output: namespace/image:latest
images: namespace/image:latest
```

### push
Expand All @@ -72,6 +72,12 @@ If the final [output](#output) image should be pushed or not.

If the action should apply the **--amend** flag to `docker manifest create` (and `docker manifest push` if [push](#push) is true). This is useful if the action has created a manifest but had errored when creating (or pushing) a merged manifest.

## Common Issues

### [image] is a manifest list

Add **provence: false** when using the `docker/build-push-action` GitHub action before using **Noelware/docker-manifest-action**, related issue: [#131](https://github.com/Noelware/docker-manifest-action/issues/131)

## Contributing

Thanks for considering contributing to **docker-manifest-action**! Before you boop your heart out on your keyboard ✧ ─=≡Σ((( つ•̀ω•́)つ, we recommend you to do the following:
Expand Down
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@noelware/docker-manifest-action",
"description": "🐻‍❄️🐳 Simple and tiny GitHub action to link Docker manifests easily!~",
"version": "0.3.0",
"version": "0.3.1",
"main": "build/action.js",
"license": "MIT",
"author": "Noelware, LLC. <team@noelware.org>",
Expand Down
14 changes: 12 additions & 2 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ export interface Input {
}

export const getInputs = (): Input | null => {
let inputs = getInput('inputs', { trimWhitespace: true, required: true })
let inputs = getInput('inputs', { trimWhitespace: true })
.split(',')
.map((i) => i.trim());

let outputs = getInput('images', { trimWhitespace: true, required: true })
let outputs = getInput('images', { trimWhitespace: true })
.split(',')
.map((i) => i.trim());

Expand All @@ -71,6 +71,11 @@ export const getInputs = (): Input | null => {
inputs = baseImages;
}

// Merge `base-images` into the inputs
if (inputs.length > 0 && baseImages.length > 0) {
inputs = inputs.concat(baseImages);
}

const extraImages = getInput('extra-images', { trimWhitespace: true })
.split(',')
.map((i) => i.trim());
Expand All @@ -80,6 +85,11 @@ export const getInputs = (): Input | null => {
outputs = extraImages;
}

// Merge `extra-images` into the outputs
if (outputs.length > 0 && extraImages.length > 0) {
outputs = outputs.concat(extraImages);
}

// Warn if we don't have any inputs
if (inputs.length === 0) {
warning('You will need to set some inputs! Did you forget to use `,` as the seperator?');
Expand Down

0 comments on commit c58b0f6

Please sign in to comment.