Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bake-target input #69

Merged
merged 1 commit into from Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -271,6 +271,7 @@ Following inputs can be used as `step.with` keys
| `labels` | List | List of custom labels |
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
| `bake-target` | String | Bake target name (default `ghaction-docker-meta`) |

### outputs

Expand Down
5 changes: 3 additions & 2 deletions __tests__/meta.test.ts
Expand Up @@ -2392,11 +2392,12 @@ describe('bake', () => {
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
]
],
bakeTarget: "meta"
} as Inputs,
{
"target": {
"ghaction-docker-meta": {
"meta": {
"tags": [
"user/app:release1",
"user/app:my",
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Expand Up @@ -25,6 +25,9 @@ inputs:
sep-labels:
description: 'Separator to use for labels output (default \n)'
required: false
bake-target:
description: 'Bake target name (default ghaction-docker-meta)'
required: false
github-token:
description: 'GitHub Token as provided by secrets'
default: ${{ github.token }}
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/context.ts
Expand Up @@ -14,6 +14,7 @@ export interface Inputs {
labels: string[];
sepTags: string;
sepLabels: string;
bakeTarget: string;
githubToken: string;
}

Expand All @@ -32,6 +33,7 @@ export function getInputs(): Inputs {
labels: getInputList('labels', true),
sepTags: core.getInput('sep-tags') || `\n`,
sepLabels: core.getInput('sep-labels') || `\n`,
bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`,
githubToken: core.getInput('github-token')
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/meta.ts
Expand Up @@ -378,7 +378,7 @@ export class Meta {
JSON.stringify(
{
target: {
'ghaction-docker-meta': {
[this.inputs.bakeTarget]: {
tags: this.getTags(),
labels: jsonLabels,
args: {
Expand Down