Compare commits

...

5 Commits

Author SHA1 Message Date
CrazyMax
0dca12c226 Update CHANGELOG 2020-11-20 20:26:04 +01:00
CrazyMax
6f270f37d4 Add test 2020-11-20 16:30:57 +01:00
CrazyMax
2860e42b1f Lowercase only on image name (#16) 2020-11-20 16:19:08 +01:00
CrazyMax
6a86fe1739 Tags to lowercase (#16) 2020-11-20 15:54:36 +01:00
CrazyMax
86dc87790d Update README 2020-11-18 17:56:39 +01:00
5 changed files with 47 additions and 11 deletions

View File

@@ -1,5 +1,9 @@
# Changelog # Changelog
## 1.8.3 (2020/11/20)
* Lowercase image name (#16)
## 1.8.2 (2020/11/18) ## 1.8.2 (2020/11/18)
* Remove duplicated tags * Remove duplicated tags

View File

@@ -292,12 +292,16 @@ If Git tag is a valid [semver](https://semver.org/) you can handle it to output
| `v1.2.3` | `v{{major}}` | :white_check_mark: | `v1`, `latest` | `v1` | | `v1.2.3` | `v{{major}}` | :white_check_mark: | `v1`, `latest` | `v1` |
| `v1.2.3` | `{{minor}}` | :white_check_mark: | `2`, `latest` | `2` | | `v1.2.3` | `{{minor}}` | :white_check_mark: | `2`, `latest` | `2` |
| `v1.2.3` | `{{patch}}` | :white_check_mark: | `3`, `latest` | `3` | | `v1.2.3` | `{{patch}}` | :white_check_mark: | `3`, `latest` | `3` |
| `v1.2.3` | `{{major}}.{{minor}}`<br>`{{major}}.{{minor}}.{{patch}}` | :white_check_mark: | `1.2`, `1.2.3`, `latest` | `1.2` | | `v1.2.3` | `{{major}}.{{minor}}`<br>`{{major}}.{{minor}}.{{patch}}` | :white_check_mark: | `1.2`, `1.2.3`, `latest` | `1.2`* |
| `v2.0.8-beta.67` | `{{raw}}` | :white_check_mark: | `v2.0.8-beta.67` | `v2.0.8-beta.67` | | `v2.0.8-beta.67` | `{{raw}}` | :white_check_mark: | `2.0.8-beta.67` | `2.0.8-beta.67` |
| `v2.0.8-beta.67` | `{{version}}` | :white_check_mark: | `2.0.8-beta.67` | `2.0.8-beta.67` | | `v2.0.8-beta.67` | `{{version}}` | :white_check_mark: | `2.0.8-beta.67` | `2.0.8-beta.67` |
| `v2.0.8-beta.67` | `{{major}}.{{minor}}` | :white_check_mark: | `2.0` | `2.0` | | `v2.0.8-beta.67` | `{{major}}.{{minor}}` | :white_check_mark: | `2.0.8-beta.67`** | `2.0.8-beta.67` |
| `release1` | `{{raw}}` | :x: | `release1` | `release1` | | `release1` | `{{raw}}` | :x: | `release1` | `release1` |
> *First occurrence of `tag-semver` will be taken as `output.version`
> **Pre-release (rc, beta, alpha) will only extend `{{version}}` as tag
### Schedule tag ### Schedule tag
`tag-schedule` is specially crafted input to support [Handlebars template](https://handlebarsjs.com/guide/) with `tag-schedule` is specially crafted input to support [Handlebars template](https://handlebarsjs.com/guide/) with

View File

@@ -928,6 +928,32 @@ describe('latest', () => {
"org.opencontainers.image.licenses=MIT" "org.opencontainers.image.licenses=MIT"
] ]
], ],
[
'event_tag_v1.1.1.env',
{
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
tagMatchLatest: false,
} as Inputs,
{
main: 'v1.1.1',
partial: [],
latest: false
} as Version,
[
'org/app:v1.1.1',
'ghcr.io/myuser/myapp:v1.1.1',
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=v1.1.1",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
])('given %p event ', tagsLabelsTest); ])('given %p event ', tagsLabelsTest);
}); });

9
dist/index.js generated vendored
View File

@@ -250,15 +250,16 @@ class Meta {
} }
let tags = []; let tags = [];
for (const image of this.inputs.images) { for (const image of this.inputs.images) {
tags.push(`${image}:${version.main}`); const imageLc = image.toLowerCase();
tags.push(`${imageLc}:${version.main}`);
for (const partial of version.partial) { for (const partial of version.partial) {
tags.push(`${image}:${partial}`); tags.push(`${imageLc}:${partial}`);
} }
if (version.latest) { if (version.latest) {
tags.push(`${image}:latest`); tags.push(`${imageLc}:latest`);
} }
if (this.context.sha && this.inputs.tagSha) { if (this.context.sha && this.inputs.tagSha) {
tags.push(`${image}:sha-${this.context.sha.substr(0, 7)}`); tags.push(`${imageLc}:sha-${this.context.sha.substr(0, 7)}`);
} }
} }
return tags; return tags;

View File

@@ -94,15 +94,16 @@ export class Meta {
let tags: Array<string> = []; let tags: Array<string> = [];
for (const image of this.inputs.images) { for (const image of this.inputs.images) {
tags.push(`${image}:${version.main}`); const imageLc = image.toLowerCase();
tags.push(`${imageLc}:${version.main}`);
for (const partial of version.partial) { for (const partial of version.partial) {
tags.push(`${image}:${partial}`); tags.push(`${imageLc}:${partial}`);
} }
if (version.latest) { if (version.latest) {
tags.push(`${image}:latest`); tags.push(`${imageLc}:latest`);
} }
if (this.context.sha && this.inputs.tagSha) { if (this.context.sha && this.inputs.tagSha) {
tags.push(`${image}:sha-${this.context.sha.substr(0, 7)}`); tags.push(`${imageLc}:sha-${this.context.sha.substr(0, 7)}`);
} }
} }
return tags; return tags;