diff --git a/.github/metadata-action.png b/.github/metadata-action.png index 8c338553..5d36826a 100644 Binary files a/.github/metadata-action.png and b/.github/metadata-action.png differ diff --git a/README.md b/README.md index 1f19037f..8ec5839a 100644 --- a/README.md +++ b/README.md @@ -152,14 +152,14 @@ jobs: This action also handles a bake definition file that can be used with the [Docker Bake action](https://github.com/docker/bake-action). You just have to declare an empty target named -`ghaction-docker-meta` and inherit from it. +`docker-metadata-action` and inherit from it. ```hcl // docker-bake.hcl -target "ghaction-docker-meta" {} +target "docker-metadata-action" {} target "build" { - inherits = ["ghaction-docker-meta"] + inherits = ["docker-metadata-action"] context = "./" dockerfile = "Dockerfile" platforms = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le"] @@ -210,7 +210,7 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with ` ```json { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "name/app:1.2.3", "name/app:1.2", @@ -263,7 +263,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`) | +| `bake-target` | String | Bake target name (default `docker-metadata-action`) | ### outputs diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index a0aee971..2320f7d6 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -5,7 +5,7 @@ import * as path from 'path'; import * as context from '../src/context'; jest.spyOn(context, 'tmpDir').mockImplementation((): string => { - const tmpDir = path.join('/tmp/.ghaction-docker-meta-jest').split(path.sep).join(path.posix.sep); + const tmpDir = path.join('/tmp/.docker-metadata-action-jest').split(path.sep).join(path.posix.sep); if (!fs.existsSync(tmpDir)) { fs.mkdirSync(tmpDir, {recursive: true}); } diff --git a/__tests__/meta.test.ts b/__tests__/meta.test.ts index 9fbb40e9..c983807a 100644 --- a/__tests__/meta.test.ts +++ b/__tests__/meta.test.ts @@ -2382,7 +2382,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "user/app:dev", "user/app:my", @@ -2419,7 +2419,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "user/app:dev", "user/app:my", @@ -2500,7 +2500,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "user/app:20200110", "user/app:my", @@ -2541,7 +2541,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "org/app:1.1.1", "org/app:1.1", @@ -2589,7 +2589,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "org/app:my", "org/app:custom", @@ -2630,7 +2630,7 @@ describe('bake', () => { } as Inputs, { "target": { - "ghaction-docker-meta": { + "docker-metadata-action": { "tags": [ "org/app:v1.1.1", "org/app:latest" diff --git a/action.yml b/action.yml index 0b2c5ce2..fc1caafe 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ inputs: description: 'Separator to use for labels output (default \n)' required: false bake-target: - description: 'Bake target name (default ghaction-docker-meta)' + description: 'Bake target name (default docker-metadata-action)' required: false github-token: description: 'GitHub Token as provided by secrets' diff --git a/dist/index.js b/dist/index.js index 3ef66efa..1166c4d8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,7 +49,7 @@ const path = __importStar(__webpack_require__(5622)); let _tmpDir; function tmpDir() { if (!_tmpDir) { - _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ghaction-docker-meta-')).split(path.sep).join(path.posix.sep); + _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-')).split(path.sep).join(path.posix.sep); } return _tmpDir; } @@ -62,7 +62,7 @@ function getInputs() { labels: getInputList('labels', true), sepTags: core.getInput('sep-tags') || `\n`, sepLabels: core.getInput('sep-labels') || `\n`, - bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`, + bakeTarget: core.getInput('bake-target') || `docker-metadata-action`, githubToken: core.getInput('github-token') }; } @@ -649,7 +649,7 @@ class Meta { } jsonLabels[matches[1]] = matches[2]; } - 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(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep); fs.writeFileSync(bakeFile, JSON.stringify({ target: { [this.inputs.bakeTarget]: { diff --git a/src/context.ts b/src/context.ts index 527b4ad0..26235ad1 100644 --- a/src/context.ts +++ b/src/context.ts @@ -20,7 +20,7 @@ export interface Inputs { export function tmpDir(): string { if (!_tmpDir) { - _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ghaction-docker-meta-')).split(path.sep).join(path.posix.sep); + _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-')).split(path.sep).join(path.posix.sep); } return _tmpDir; } @@ -33,7 +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`, + bakeTarget: core.getInput('bake-target') || `docker-metadata-action`, githubToken: core.getInput('github-token') }; } diff --git a/src/meta.ts b/src/meta.ts index a0b1daaf..43b47e09 100644 --- a/src/meta.ts +++ b/src/meta.ts @@ -322,7 +322,7 @@ export class Meta { jsonLabels[matches[1]] = matches[2]; } - const bakeFile = path.join(tmpDir(), 'ghaction-docker-meta-bake.json').split(path.sep).join(path.posix.sep); + const bakeFile = path.join(tmpDir(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep); fs.writeFileSync( bakeFile, JSON.stringify( diff --git a/test/docker-bake.hcl b/test/docker-bake.hcl index eef851f9..a458d320 100644 --- a/test/docker-bake.hcl +++ b/test/docker-bake.hcl @@ -1,4 +1,4 @@ -target "ghaction-docker-meta" {} +target "docker-metadata-action" {} group "default" { targets = ["db", "app"] @@ -14,7 +14,7 @@ target "db" { } target "app" { - inherits = ["ghaction-docker-meta"] + inherits = ["docker-metadata-action"] context = "./test" dockerfile = "Dockerfile" args = {