Skip to content

Commit 5f26473

Browse files
committed
docs: update links and layout
Signed-off-by: CrazyMax <[email protected]>
1 parent 49e79e3 commit 5f26473

File tree

6 files changed

+79
-74
lines changed

6 files changed

+79
-74
lines changed

README.md

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
## About
77

8-
GitHub Action to extract metadata from Git reference and GitHub events.
9-
This action is particularly useful if used with [Docker Build Push](https://github.com/docker/build-push-action) action to tag and label Docker images.
8+
GitHub Action to extract metadata from Git reference and GitHub events. This action
9+
is particularly useful if used with [Docker Build Push](https://github.com/docker/build-push-action)
10+
action to tag and label Docker images.
1011

1112
![Screenshot](.github/metadata-action.png)
1213

@@ -44,7 +45,7 @@ ___
4445
* [Major version zero](#major-version-zero)
4546
* [JSON output object](#json-output-object)
4647
* [Overwrite labels](#overwrite-labels)
47-
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
48+
* [Contributing](#contributing)
4849

4950
## Usage
5051

@@ -165,8 +166,8 @@ jobs:
165166
### Bake definition
166167

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

171172
```hcl
172173
// docker-bake.hcl
@@ -226,7 +227,8 @@ jobs:
226227
targets: build
227228
```
228229

229-
Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with `refs/tags/v1.2.3` ref:
230+
Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with
231+
`refs/tags/v1.2.3` ref:
230232

231233
```json
232234
{
@@ -285,13 +287,13 @@ Following inputs can be used as `step.with` keys
285287

286288
Following outputs are available
287289

288-
| Name | Type | Description |
289-
|---------------|---------|-------------------------------------------------------------------------------|
290-
| `version` | String | Docker image version |
291-
| `tags` | String | Docker tags |
292-
| `labels` | String | Docker labels |
293-
| `json` | String | JSON output of tags and labels |
294-
| `bake-file` | File | [Bake definition file](https://github.com/docker/buildx#file-definition) path |
290+
| Name | Type | Description |
291+
|---------------|---------|--------------------------------------------------------------------------------------------|
292+
| `version` | String | Docker image version |
293+
| `tags` | String | Docker tags |
294+
| `labels` | String | Docker labels |
295+
| `json` | String | JSON output of tags and labels |
296+
| `bake-file` | File | [Bake file definition](https://docs.docker.com/build/customize/bake/file-definition/) path |
295297

296298
## `images` input
297299

@@ -328,13 +330,16 @@ flavor: |
328330
```
329331

330332
* `latest=<auto|true|false>`: Handle [latest tag](#latest-tag) (default `auto`)
331-
* `prefix=<string>,onlatest=<true|false>`: A global prefix for each generated tag and optionally for `latest`
332-
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated tag and optionally for `latest`
333+
* `prefix=<string>,onlatest=<true|false>`: A global prefix for each generated
334+
tag and optionally for `latest`
335+
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated
336+
tag and optionally for `latest`
333337

334338
## `tags` input
335339

336-
`tags` is the core input of this action as everything related to it will reflect the output metadata. This one is in
337-
the form of a key-value pair list in CSV format to remove limitations intrinsically linked to GitHub Actions
340+
`tags` is the core input of this action as everything related to it will
341+
reflect the output metadata. This one is in the form of a key-value pair list
342+
in CSV format to remove limitations intrinsically linked to GitHub Actions
338343
(only string format is handled in the input fields). Here is an example:
339344

340345
```yaml
@@ -388,10 +393,11 @@ tags: |
388393
type=schedule,pattern={{date 'YYYYMMDD'}}
389394
```
390395

391-
Will be used on [schedule event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule).
396+
Will be used on [schedule event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule).
397+
398+
`pattern` is a specially crafted attribute to support [Handlebars' template](https://handlebarsjs.com/guide/)
399+
with the following expressions:
392400

393-
`pattern` is a specially crafted attribute to support [Handlebars' template](https://handlebarsjs.com/guide/) with
394-
the following expressions:
395401
* `date 'format'` ; render date by its [moment format](https://momentjs.com/docs/#/displaying/format/)
396402

397403
| Pattern | Output |
@@ -416,11 +422,13 @@ tags: |
416422
type=semver,pattern={{version}},value=v1.0.0
417423
```
418424

419-
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
420-
and requires a valid [semver](https://semver.org/) Git tag, but you can also use a custom value through `value`
421-
attribute.
425+
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
426+
and requires a valid [semver](https://semver.org/) Git tag, but you can also
427+
use a custom value through `value` attribute.
428+
429+
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/)
430+
with the following expressions:
422431

423-
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
424432
* `raw` ; the actual tag
425433
* `version` ; shorthand for `{{major}}.{{minor}}.{{patch}}` (can include pre-release)
426434
* `major` ; major version identifier
@@ -439,9 +447,10 @@ attribute.
439447
| `v2.0.8-beta.67` | `{{version}}` | `2.0.8-beta.67` |
440448
| `v2.0.8-beta.67` | `{{major}}.{{minor}}` | `2.0.8-beta.67`* |
441449

442-
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}` if specified) as tag
443-
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
444-
> not yet fit for public consumption.
450+
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}`
451+
> if specified) as tag because they are updated frequently, and contain many
452+
> breaking changes that are (by the author's design) not yet fit for public
453+
> consumption.
445454

446455
Extended attributes and default values:
447456

@@ -460,11 +469,13 @@ tags: |
460469
type=pep440,pattern={{version}},value=1.0.0
461470
```
462471

463-
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
464-
and requires a Git tag that conforms to [PEP 440](https://www.python.org/dev/peps/pep-0440/), but you can also use a
465-
custom value through `value` attribute.
472+
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
473+
and requires a Git tag that conforms to [PEP 440](https://www.python.org/dev/peps/pep-0440/),
474+
but you can also use a custom value through `value` attribute.
475+
476+
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/)
477+
with the following expressions:
466478

467-
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
468479
* `raw` ; the actual tag
469480
* `version` ; cleaned version
470481
* `major` ; major version identifier
@@ -485,9 +496,10 @@ custom value through `value` attribute.
485496
| `1.2.3beta2` | `{{major}}.{{minor}}` | `1.2.3b2`* |
486497
| `1.0dev4` | `{{major}}.{{minor}}` | `1.0.dev4`* |
487498

488-
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if specified) as tag
489-
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
490-
> not yet fit for public consumption.
499+
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if
500+
> specified) as tag because they are updated frequently, and contain many
501+
> breaking changes that are (by the author's design) not yet fit for public
502+
> consumption.
491503

492504
Extended attributes and default values:
493505

@@ -508,9 +520,9 @@ tags: |
508520
type=match,pattern=v(.*),group=1,value=v1.0.0
509521
```
510522

511-
Can create a regular expression for matching Git tag with a pattern and capturing group. Will be used on a
512-
[push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push) but, you can also use
513-
a custom value through `value` attribute.
523+
Can create a regular expression for matching Git tag with a pattern and
524+
capturing group. Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
525+
but, you can also use a custom value through `value` attribute.
514526

515527
| Git tag | Pattern | Group | Output |
516528
|-------------------------|------------------|---------|------------------------|
@@ -537,9 +549,9 @@ tags: |
537549
type=edge,branch=main
538550
```
539551

540-
An `edge` tag reflects the last commit of the active branch on your Git repository. I usually prefer to use `edge`
541-
as a Docker tag for a better distinction or common pattern. This is also used by official images
542-
like [Alpine](https://hub.docker.com/_/alpine).
552+
An `edge` tag reflects the last commit of the active branch on your Git
553+
repository. I usually prefer to use `edge` as a Docker tag for a better
554+
distinction or common pattern. This is also used by official images like [Alpine](https://hub.docker.com/_/alpine).
543555

544556
Extended attributes and default values:
545557

@@ -561,6 +573,7 @@ tags: |
561573
```
562574

563575
This type handles Git ref (or reference) for the following events:
576+
564577
* `branch` ; eg. `refs/heads/master`
565578
* `tag` ; eg. `refs/tags/v1.0.0`
566579
* `pr` ; eg. `refs/pull/318/merge`
@@ -632,7 +645,7 @@ tags: |
632645

633646
### Image name and tag sanitization
634647

635-
In order to comply with [the specification](https://docs.docker.com/engine/reference/commandline/tag/#extended-description),
648+
In order to comply with [the specification](https://docs.docker.com/engine/reference/commandline/tag/#description),
636649
the image name components may contain lowercase letters, digits and separators.
637650
A separator is defined as a period, one or two underscores, or one or more
638651
dashes. A name component may not start or end with a separator.
@@ -648,7 +661,9 @@ To ease the integration in your workflow, this action will automatically:
648661

649662
### Latest tag
650663

651-
`latest` tag is handled through the [`flavor` input](#flavor-input). It will be generated by default (`auto` mode) for:
664+
`latest` tag is handled through the [`flavor` input](#flavor-input). It will be
665+
generated by default (`auto` mode) for:
666+
652667
* [`type=ref,event=tag`](#typeref)
653668
* [`type=semver,pattern=...`](#typesemver)
654669
* [`type=match,pattern=...`](#typematch)
@@ -707,12 +722,12 @@ tags: |
707722
Returns the branch name that triggered the workflow run. Will be empty if not
708723
a branch reference:
709724

710-
| Event | Ref | Output |
711-
|-----------------|-------------------------------|---------------------|
712-
| `pull_request` | `refs/pull/2/merge` | |
713-
| `push` | `refs/heads/master` | `master` |
714-
| `push` | `refs/heads/my/branch` | `my-branch` |
715-
| `push tag` | `refs/tags/v1.2.3` | |
725+
| Event | Ref | Output |
726+
|----------------|------------------------|-------------|
727+
| `pull_request` | `refs/pull/2/merge` | |
728+
| `push` | `refs/heads/master` | `master` |
729+
| `push` | `refs/heads/my/branch` | `my-branch` |
730+
| `push tag` | `refs/tags/v1.2.3` | |
716731

717732
#### `{{tag}}`
718733

@@ -764,11 +779,11 @@ Returns the current date rendered by its [moment format](https://momentjs.com/do
764779

765780
### Major version zero
766781

767-
Major version zero (`0.y.z`) is for initial development and **may** change at any time. This means the public API
768-
[**should not** be considered stable](https://semver.org/#spec-item-4).
782+
Major version zero (`0.y.z`) is for initial development and **may** change at
783+
any time. This means the public API [**should not** be considered stable](https://semver.org/#spec-item-4).
769784

770-
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver) with `{{major}}`
771-
pattern. You can manage this behavior like this:
785+
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver)
786+
with `{{major}}` pattern. You can manage this behavior like this:
772787

773788
```yaml
774789
# refs/tags/v0.1.2
@@ -783,8 +798,8 @@ tags: |
783798

784799
### JSON output object
785800

786-
The `json` output is a JSON object composed of the generated tags and labels so that you can reuse them further in your
787-
workflow using the [`fromJSON` function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson):
801+
The `json` output is a JSON object composed of the generated tags and labels so
802+
that you can reuse them further in your workflow using the [`fromJSON` function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson):
788803

789804
```yaml
790805
-
@@ -824,18 +839,7 @@ labels generated are not suitable, you can overwrite them like this:
824839
org.opencontainers.image.vendor=MyCompany
825840
```
826841

827-
## Keep up-to-date with GitHub Dependabot
828-
829-
Since [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot)
830-
has [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),
831-
to enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:
842+
## Contributing
832843

833-
```yaml
834-
version: 2
835-
updates:
836-
# Maintain dependencies for GitHub Actions
837-
- package-ecosystem: "github-actions"
838-
directory: "/"
839-
schedule:
840-
interval: "daily"
841-
```
844+
Want to contribute? Awesome! You can find information about contributing to
845+
this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)

UPGRADE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## v2 to v3
44

5-
* Repository has been moved to docker org. Replace `crazy-max/ghaction-docker-meta@v2` with `docker/metadata-action@v4`
5+
* Repository has been moved to docker org. Replace `crazy-max/ghaction-docker-meta@v2`
6+
with `docker/metadata-action@v4`
67
* The default bake target has been changed: `ghaction-docker-meta` > `docker-metadata-action`
78

89
## v1 to v2

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ async function run() {
7272
core.endGroup();
7373
setOutput('json', jsonOutput);
7474

75-
// Bake definition file
75+
// Bake file definition
7676
const bakeFile: string = meta.getBakeFile();
77-
core.startGroup(`Bake definition file`);
77+
core.startGroup(`Bake file definition`);
7878
core.info(fs.readFileSync(bakeFile, 'utf8'));
7979
core.endGroup();
8080
setOutput('bake-file', bakeFile);

test/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
# syntax=docker/dockerfile:1
12
FROM alpine
2-
33
RUN echo "Hello world!"

0 commit comments

Comments
 (0)