Skip to content

Commit 4a4aa3e

Browse files
committed
fix: correct pattern examples
Signed-off-by: Anbraten <[email protected]>
1 parent a64d048 commit 4a4aa3e

File tree

5 files changed

+174
-174
lines changed

5 files changed

+174
-174
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ tags: |
603603
```yaml
604604
tags: |
605605
# minimal
606-
type=match,pattern=\d.\d.\d
606+
type=match,"pattern=\\d+.\\d+.\\d+"
607607
# define match group
608608
type=match,pattern=v(.*),group=1
609609
# use custom value instead of git tag
@@ -614,13 +614,13 @@ Can create a regular expression for matching Git tag with a pattern and
614614
capturing group. Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
615615
but, you can also use a custom value through `value` attribute.
616616

617-
| Git tag | Pattern | Group | Output |
618-
|-------------------------|------------------|---------|------------------------|
619-
| `v1.2.3` | `\d.\d.\d` | `0` | `1.2.3` |
620-
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
621-
| `v2.0.8-beta.67` | `v(\d.\d)` | `1` | `2.0` |
622-
| `20200110-RC2` | `\d+` | `0` | `20200110` |
623-
| `p1/v1.2.3` | `p1/v(\d.\d.\d)` | `1` | `1.2.3` |
617+
| Git tag | Pattern | Group | Output |
618+
|-------------------------|-----------------------------|---------|---------------|
619+
| `v1.2.3` | `\\d+\\.\\d+\\.\\d+` | `0` | `1.2.3` |
620+
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
621+
| `v2.0.8-beta.67` | `v(\\d+\\.\\d+\\.)` | `1` | `2.0` |
622+
| `20200110-RC2` | `\d+?` | `0` | `20200110` |
623+
| `p1/v1.2.3` | `p1\/v(\\d+\\.\\d+\\.\\d+)` | `1` | `1.2.3` |
624624

625625
Extended attributes and default values:
626626

@@ -809,7 +809,7 @@ tags: |
809809

810810
#### `{{branch}}`
811811

812-
Returns the branch name that triggered the workflow run. Will be empty if not
812+
Returns the branch name that triggered the workflow run. Will be empty if not
813813
a branch reference:
814814

815815
| Event | Ref | Output |
@@ -847,11 +847,11 @@ workflow run. Will be empty for a branch reference:
847847
| `push` | `refs/heads/my/branch` | |
848848
| `push tag`* | `refs/tags/v1.2.3` | `master` |
849849

850-
> *`base_ref` is available in the push payload but doesn't always seem to
850+
> *`base_ref` is available in the push payload but doesn't always seem to
851851
> return the expected branch when the push tag event occurs. It's also
852852
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
853853
> We keep it for backward compatibility, but it's **not recommended relying on it**.
854-
> More context in [#192](https://github.com/docker/metadata-action/pull/192#discussion_r854673012).
854+
> More context in [#192](https://github.com/docker/metadata-action/pull/192#discussion_r854673012).
855855

856856
#### `{{is_default_branch}}`
857857

__tests__/fixtures/event_release_created.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ GITHUB_GRAPHQL_URL=https://api.github.com/graphql
1313
GITHUB_HEAD_REF=
1414
GITHUB_JOB=test
1515
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_82c844c7-54b3-4b5d-a1e1-4f9f2e936d4f
16-
GITHUB_REF=refs/tags/v1.1.1
17-
GITHUB_REF_NAME=v1.1.1
16+
GITHUB_REF=refs/tags/v101.12.13
17+
GITHUB_REF_NAME=v101.12.13
1818
GITHUB_REF_PROTECTED=false
1919
GITHUB_REF_TYPE=tag
2020
GITHUB_REPOSITORY=docker/test-docker-action

__tests__/fixtures/event_tag_v1.1.1.env renamed to __tests__/fixtures/event_tag_v101.12.13.env

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ GITHUB_API_URL=https://api.github.com
88
GITHUB_BASE_REF=
99
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
1010
GITHUB_EVENT_NAME=push
11-
GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_v1.1.1.json
11+
GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_v101.12.13.json
1212
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
1313
GITHUB_HEAD_REF=
1414
GITHUB_JOB=test
1515
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
16-
GITHUB_REF=refs/tags/v1.1.1
17-
GITHUB_REF_NAME=v1.1.1
16+
GITHUB_REF=refs/tags/v101.12.13
17+
GITHUB_REF_NAME=v101.12.13
1818
GITHUB_REF_PROTECTED=false
1919
GITHUB_REF_TYPE=tag
2020
GITHUB_REPOSITORY=docker/test-docker-action
File renamed without changes.

0 commit comments

Comments
 (0)