Skip to content

Commit 8d3d13f

Browse files
authored
Merge pull request #77 from crazy-max/rename-bake-target
Rename bake target
2 parents c8b87a0 + ed01528 commit 8d3d13f

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

.github/metadata-action.png

1.01 KB
Loading

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ jobs:
152152

153153
This action also handles a bake definition file that can be used with the
154154
[Docker Bake action](https://github.com/docker/bake-action). You just have to declare an empty target named
155-
`ghaction-docker-meta` and inherit from it.
155+
`docker-metadata-action` and inherit from it.
156156

157157
```hcl
158158
// docker-bake.hcl
159-
target "ghaction-docker-meta" {}
159+
target "docker-metadata-action" {}
160160
161161
target "build" {
162-
inherits = ["ghaction-docker-meta"]
162+
inherits = ["docker-metadata-action"]
163163
context = "./"
164164
dockerfile = "Dockerfile"
165165
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 `
210210
```json
211211
{
212212
"target": {
213-
"ghaction-docker-meta": {
213+
"docker-metadata-action": {
214214
"tags": [
215215
"name/app:1.2.3",
216216
"name/app:1.2",
@@ -263,7 +263,7 @@ Following inputs can be used as `step.with` keys
263263
| `labels` | List | List of custom labels |
264264
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
265265
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
266-
| `bake-target` | String | Bake target name (default `ghaction-docker-meta`) |
266+
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
267267

268268
### outputs
269269

__tests__/context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as path from 'path';
55
import * as context from '../src/context';
66

77
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
8-
const tmpDir = path.join('/tmp/.ghaction-docker-meta-jest').split(path.sep).join(path.posix.sep);
8+
const tmpDir = path.join('/tmp/.docker-metadata-action-jest').split(path.sep).join(path.posix.sep);
99
if (!fs.existsSync(tmpDir)) {
1010
fs.mkdirSync(tmpDir, {recursive: true});
1111
}

__tests__/meta.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ describe('bake', () => {
23822382
} as Inputs,
23832383
{
23842384
"target": {
2385-
"ghaction-docker-meta": {
2385+
"docker-metadata-action": {
23862386
"tags": [
23872387
"user/app:dev",
23882388
"user/app:my",
@@ -2419,7 +2419,7 @@ describe('bake', () => {
24192419
} as Inputs,
24202420
{
24212421
"target": {
2422-
"ghaction-docker-meta": {
2422+
"docker-metadata-action": {
24232423
"tags": [
24242424
"user/app:dev",
24252425
"user/app:my",
@@ -2500,7 +2500,7 @@ describe('bake', () => {
25002500
} as Inputs,
25012501
{
25022502
"target": {
2503-
"ghaction-docker-meta": {
2503+
"docker-metadata-action": {
25042504
"tags": [
25052505
"user/app:20200110",
25062506
"user/app:my",
@@ -2541,7 +2541,7 @@ describe('bake', () => {
25412541
} as Inputs,
25422542
{
25432543
"target": {
2544-
"ghaction-docker-meta": {
2544+
"docker-metadata-action": {
25452545
"tags": [
25462546
"org/app:1.1.1",
25472547
"org/app:1.1",
@@ -2589,7 +2589,7 @@ describe('bake', () => {
25892589
} as Inputs,
25902590
{
25912591
"target": {
2592-
"ghaction-docker-meta": {
2592+
"docker-metadata-action": {
25932593
"tags": [
25942594
"org/app:my",
25952595
"org/app:custom",
@@ -2630,7 +2630,7 @@ describe('bake', () => {
26302630
} as Inputs,
26312631
{
26322632
"target": {
2633-
"ghaction-docker-meta": {
2633+
"docker-metadata-action": {
26342634
"tags": [
26352635
"org/app:v1.1.1",
26362636
"org/app:latest"

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ inputs:
2626
description: 'Separator to use for labels output (default \n)'
2727
required: false
2828
bake-target:
29-
description: 'Bake target name (default ghaction-docker-meta)'
29+
description: 'Bake target name (default docker-metadata-action)'
3030
required: false
3131
github-token:
3232
description: 'GitHub Token as provided by secrets'

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface Inputs {
2020

2121
export function tmpDir(): string {
2222
if (!_tmpDir) {
23-
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ghaction-docker-meta-')).split(path.sep).join(path.posix.sep);
23+
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-')).split(path.sep).join(path.posix.sep);
2424
}
2525
return _tmpDir;
2626
}
@@ -33,7 +33,7 @@ export function getInputs(): Inputs {
3333
labels: getInputList('labels', true),
3434
sepTags: core.getInput('sep-tags') || `\n`,
3535
sepLabels: core.getInput('sep-labels') || `\n`,
36-
bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`,
36+
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
3737
githubToken: core.getInput('github-token')
3838
};
3939
}

src/meta.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export class Meta {
322322
jsonLabels[matches[1]] = matches[2];
323323
}
324324

325-
const bakeFile = path.join(tmpDir(), 'ghaction-docker-meta-bake.json').split(path.sep).join(path.posix.sep);
325+
const bakeFile = path.join(tmpDir(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep);
326326
fs.writeFileSync(
327327
bakeFile,
328328
JSON.stringify(

test/docker-bake.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target "ghaction-docker-meta" {}
1+
target "docker-metadata-action" {}
22

33
group "default" {
44
targets = ["db", "app"]
@@ -14,7 +14,7 @@ target "db" {
1414
}
1515

1616
target "app" {
17-
inherits = ["ghaction-docker-meta"]
17+
inherits = ["docker-metadata-action"]
1818
context = "./test"
1919
dockerfile = "Dockerfile"
2020
args = {

0 commit comments

Comments
 (0)