mirror of
https://github.com/docker/metadata-action.git
synced 2024-11-22 12:05:41 +01:00
Add bake-target input (#69)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
ae431178c1
commit
72e5d60481
@ -271,6 +271,7 @@ Following inputs can be used as `step.with` keys
|
|||||||
| `labels` | List | List of custom labels |
|
| `labels` | List | List of custom labels |
|
||||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||||
| `sep-labels` | String | Separator to use for labels 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
|
### outputs
|
||||||
|
|
||||||
|
@ -2392,11 +2392,12 @@ describe('bake', () => {
|
|||||||
`type=raw,my`,
|
`type=raw,my`,
|
||||||
`type=raw,custom`,
|
`type=raw,custom`,
|
||||||
`type=raw,tags`
|
`type=raw,tags`
|
||||||
]
|
],
|
||||||
|
bakeTarget: "meta"
|
||||||
} as Inputs,
|
} as Inputs,
|
||||||
{
|
{
|
||||||
"target": {
|
"target": {
|
||||||
"ghaction-docker-meta": {
|
"meta": {
|
||||||
"tags": [
|
"tags": [
|
||||||
"user/app:release1",
|
"user/app:release1",
|
||||||
"user/app:my",
|
"user/app:my",
|
||||||
|
@ -25,6 +25,9 @@ inputs:
|
|||||||
sep-labels:
|
sep-labels:
|
||||||
description: 'Separator to use for labels output (default \n)'
|
description: 'Separator to use for labels output (default \n)'
|
||||||
required: false
|
required: false
|
||||||
|
bake-target:
|
||||||
|
description: 'Bake target name (default ghaction-docker-meta)'
|
||||||
|
required: false
|
||||||
github-token:
|
github-token:
|
||||||
description: 'GitHub Token as provided by secrets'
|
description: 'GitHub Token as provided by secrets'
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
3
dist/index.js
generated
vendored
3
dist/index.js
generated
vendored
@ -62,6 +62,7 @@ function getInputs() {
|
|||||||
labels: getInputList('labels', true),
|
labels: getInputList('labels', true),
|
||||||
sepTags: core.getInput('sep-tags') || `\n`,
|
sepTags: core.getInput('sep-tags') || `\n`,
|
||||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
sepLabels: core.getInput('sep-labels') || `\n`,
|
||||||
|
bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`,
|
||||||
githubToken: core.getInput('github-token')
|
githubToken: core.getInput('github-token')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -698,7 +699,7 @@ class Meta {
|
|||||||
const bakeFile = path.join(context_1.tmpDir(), 'ghaction-docker-meta-bake.json').split(path.sep).join(path.posix.sep);
|
const bakeFile = path.join(context_1.tmpDir(), 'ghaction-docker-meta-bake.json').split(path.sep).join(path.posix.sep);
|
||||||
fs.writeFileSync(bakeFile, JSON.stringify({
|
fs.writeFileSync(bakeFile, JSON.stringify({
|
||||||
target: {
|
target: {
|
||||||
'ghaction-docker-meta': {
|
[this.inputs.bakeTarget]: {
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
labels: jsonLabels,
|
labels: jsonLabels,
|
||||||
args: {
|
args: {
|
||||||
|
@ -14,6 +14,7 @@ export interface Inputs {
|
|||||||
labels: string[];
|
labels: string[];
|
||||||
sepTags: string;
|
sepTags: string;
|
||||||
sepLabels: string;
|
sepLabels: string;
|
||||||
|
bakeTarget: string;
|
||||||
githubToken: string;
|
githubToken: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ export function getInputs(): Inputs {
|
|||||||
labels: getInputList('labels', true),
|
labels: getInputList('labels', true),
|
||||||
sepTags: core.getInput('sep-tags') || `\n`,
|
sepTags: core.getInput('sep-tags') || `\n`,
|
||||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
sepLabels: core.getInput('sep-labels') || `\n`,
|
||||||
|
bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`,
|
||||||
githubToken: core.getInput('github-token')
|
githubToken: core.getInput('github-token')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -378,7 +378,7 @@ export class Meta {
|
|||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
{
|
{
|
||||||
target: {
|
target: {
|
||||||
'ghaction-docker-meta': {
|
[this.inputs.bakeTarget]: {
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
labels: jsonLabels,
|
labels: jsonLabels,
|
||||||
args: {
|
args: {
|
||||||
|
Loading…
Reference in New Issue
Block a user