mirror of
https://github.com/docker/metadata-action.git
synced 2025-12-06 17:06:46 +03:00
Compare commits
No commits in common. "master" and "v5.7.0" have entirely different histories.
43
.github/workflows/ci.yml
vendored
43
.github/workflows/ci.yml
vendored
@ -31,7 +31,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -80,7 +80,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -116,7 +116,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -150,7 +150,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -181,7 +181,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -204,7 +204,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -225,7 +225,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -255,7 +255,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -278,14 +278,13 @@ jobs:
|
|||||||
type=raw,value=gexp-tag-{{tag}}
|
type=raw,value=gexp-tag-{{tag}}
|
||||||
type=raw,value=gexp-baseref-{{base_ref}}
|
type=raw,value=gexp-baseref-{{base_ref}}
|
||||||
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
||||||
type=raw,value=gexp-notdefbranch,enable={{is_not_default_branch}}
|
|
||||||
|
|
||||||
json:
|
json:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -320,7 +319,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -368,7 +367,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -413,7 +412,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -431,7 +430,7 @@ jobs:
|
|||||||
sep-tags: ${{ matrix.sep }}
|
sep-tags: ${{ matrix.sep }}
|
||||||
-
|
-
|
||||||
name: Tags
|
name: Tags
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
console.log(`${{ steps.meta.outputs.tags }}`);
|
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||||
@ -441,7 +440,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -480,7 +479,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -504,7 +503,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -545,7 +544,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -571,7 +570,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -604,7 +603,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@ -628,7 +627,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Dump context
|
name: Dump context
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
uses: crazy-max/ghaction-dump-context@v2
|
||||||
|
|||||||
17
.github/workflows/pr-assign-author.yml
vendored
17
.github/workflows/pr-assign-author.yml
vendored
@ -1,17 +0,0 @@
|
|||||||
name: pr-assign-author
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- reopened
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
run:
|
|
||||||
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Publish
|
name: Publish
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
|||||||
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -15,18 +15,14 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
source: .
|
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
files: ./coverage/clover.xml
|
file: ./coverage/clover.xml
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
2
.github/workflows/validate.yml
vendored
2
.github/workflows/validate.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: List targets
|
name: List targets
|
||||||
id: generate
|
id: generate
|
||||||
|
|||||||
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
12
.yarnrc.yml
12
.yarnrc.yml
@ -1,9 +1,3 @@
|
|||||||
# https://yarnpkg.com/configuration/yarnrc
|
|
||||||
|
|
||||||
compressionLevel: mixed
|
|
||||||
enableGlobalCache: false
|
|
||||||
enableHardenedMode: true
|
|
||||||
|
|
||||||
logFilters:
|
logFilters:
|
||||||
- code: YN0013
|
- code: YN0013
|
||||||
level: discard
|
level: discard
|
||||||
@ -11,7 +5,9 @@ logFilters:
|
|||||||
level: discard
|
level: discard
|
||||||
- code: YN0076
|
- code: YN0076
|
||||||
level: discard
|
level: discard
|
||||||
- code: YN0086
|
|
||||||
level: discard
|
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||||
|
spec: "@yarnpkg/plugin-interactive-tools"
|
||||||
|
|||||||
74
README.md
74
README.md
@ -44,7 +44,6 @@ ___
|
|||||||
* [`{{sha}}`](#sha)
|
* [`{{sha}}`](#sha)
|
||||||
* [`{{base_ref}}`](#base_ref)
|
* [`{{base_ref}}`](#base_ref)
|
||||||
* [`{{is_default_branch}}`](#is_default_branch)
|
* [`{{is_default_branch}}`](#is_default_branch)
|
||||||
* [`{{is_not_default_branch}}`](#is_not_default_branch)
|
|
||||||
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
||||||
* [`{{commit_date '<format>' tz='<timezone>'}}`](#commit_date-format-tztimezone)
|
* [`{{commit_date '<format>' tz='<timezone>'}}`](#commit_date-format-tztimezone)
|
||||||
* [Major version zero](#major-version-zero)
|
* [Major version zero](#major-version-zero)
|
||||||
@ -77,7 +76,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -131,7 +130,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -284,7 +283,6 @@ similar to the previous one:
|
|||||||
|
|
||||||
The following inputs can be used as `step.with` keys:
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
> [!NOTE]
|
|
||||||
> `List` type is a newline-delimited string
|
> `List` type is a newline-delimited string
|
||||||
> ```yaml
|
> ```yaml
|
||||||
> labels: |
|
> labels: |
|
||||||
@ -314,7 +312,6 @@ The following outputs are available:
|
|||||||
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `version` | String | Docker image version |
|
| `version` | String | Docker image version |
|
||||||
| `tags` | String | Docker tags |
|
| `tags` | String | Docker tags |
|
||||||
| `tag-names` | String | Docker tag names without image base name |
|
|
||||||
| `labels` | String | Docker labels |
|
| `labels` | String | Docker labels |
|
||||||
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||||
| `json` | String | JSON output of tags and labels |
|
| `json` | String | JSON output of tags and labels |
|
||||||
@ -464,7 +461,7 @@ tags: |
|
|||||||
# handlebars
|
# handlebars
|
||||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
# handlebars with timezone
|
# handlebars with timezone
|
||||||
type=schedule,pattern={{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}
|
type=schedule,pattern={{date 'YYYYMMDD-hhmmss' tz='Asia/Tokyo'}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on [schedule event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule).
|
Will be used on [schedule event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule).
|
||||||
@ -496,8 +493,6 @@ tags: |
|
|||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
# use custom value instead of git tag
|
# use custom value instead of git tag
|
||||||
type=semver,pattern={{version}},value=v1.0.0
|
type=semver,pattern={{version}},value=v1.0.0
|
||||||
# use custom value and match part of it
|
|
||||||
type=semver,pattern={{version}},value=p1/v1.0.0,match=v(\d.\d.\d)$
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||||
@ -513,21 +508,18 @@ with the following expressions:
|
|||||||
* `minor` ; minor version identifier
|
* `minor` ; minor version identifier
|
||||||
* `patch` ; patch version identifier
|
* `patch` ; patch version identifier
|
||||||
|
|
||||||
| Git tag | Pattern | Match | Output |
|
| Git tag | Pattern | Output |
|
||||||
|------------------|-----------------------|----------------|------------------|
|
|--------------------|----------------------------------------------------------|----------------------|
|
||||||
| `v1.2.3` | `{{raw}}` | | `v1.2.3` |
|
| `v1.2.3` | `{{raw}}` | `v1.2.3` |
|
||||||
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
||||||
| `v1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
| `v1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
||||||
| `v1.2.3` | `v{{major}}` | | `v1` |
|
| `v1.2.3` | `v{{major}}` | `v1` |
|
||||||
| `v1.2.3` | `{{minor}}` | | `2` |
|
| `v1.2.3` | `{{minor}}` | `2` |
|
||||||
| `v1.2.3` | `{{patch}}` | | `3` |
|
| `v1.2.3` | `{{patch}}` | `3` |
|
||||||
| `p1/v1.2.3` | `{{version}}` | `v(\d.\d.\d)$` | `1.2.3` |
|
| `v2.0.8-beta.67` | `{{raw}}` | `v2.0.8-beta.67` |
|
||||||
| `v2.0.8-beta.67` | `{{raw}}` | | `v2.0.8-beta.67` |
|
| `v2.0.8-beta.67` | `{{version}}` | `2.0.8-beta.67` |
|
||||||
| `v2.0.8-beta.67` | `{{version}}` | | `2.0.8-beta.67` |
|
| `v2.0.8-beta.67` | `{{major}}.{{minor}}` | `2.0.8-beta.67`* |
|
||||||
| `v2.0.8-beta.67` | `{{major}}` | | `2.0.8-beta.67`* |
|
|
||||||
| `v2.0.8-beta.67` | `{{major}}.{{minor}}` | | `2.0.8-beta.67`* |
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}`
|
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}`
|
||||||
> if specified) as tag because they are updated frequently, and contain many
|
> if specified) as tag because they are updated frequently, and contain many
|
||||||
> breaking changes that are (by the author's design) not yet fit for public
|
> breaking changes that are (by the author's design) not yet fit for public
|
||||||
@ -537,7 +529,7 @@ Extended attributes and default values:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=,match=
|
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=
|
||||||
```
|
```
|
||||||
|
|
||||||
### `type=pep440`
|
### `type=pep440`
|
||||||
@ -548,8 +540,6 @@ tags: |
|
|||||||
type=pep440,pattern={{version}}
|
type=pep440,pattern={{version}}
|
||||||
# use custom value instead of git tag
|
# use custom value instead of git tag
|
||||||
type=pep440,pattern={{version}},value=1.0.0
|
type=pep440,pattern={{version}},value=1.0.0
|
||||||
# use custom value and match part of it
|
|
||||||
type=pep440,pattern={{version}},value=p1/v1.0.0,match=v(\d.\d.\d)$
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||||
@ -565,22 +555,20 @@ with the following expressions:
|
|||||||
* `minor` ; minor version identifier
|
* `minor` ; minor version identifier
|
||||||
* `patch` ; patch version identifier
|
* `patch` ; patch version identifier
|
||||||
|
|
||||||
| Git tag | Pattern | Match | Output |
|
| Git tag | Pattern | Output |
|
||||||
|--------------|-----------------------|----------------|----------------|
|
|--------------------|----------------------------------------------------------|----------------------|
|
||||||
| `1.2.3` | `{{raw}}` | | `1.2.3` |
|
| `1.2.3` | `{{raw}}` | `1.2.3` |
|
||||||
| `1.2.3` | `{{version}}` | | `1.2.3` |
|
| `1.2.3` | `{{version}}` | `1.2.3` |
|
||||||
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
||||||
| `1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
| `1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
||||||
| `1.2.3` | `v{{major}}` | | `v1` |
|
| `1.2.3` | `v{{major}}` | `v1` |
|
||||||
| `v1.2.3rc2` | `{{raw}}` | | `v1.2.3rc2` |
|
| `v1.2.3rc2` | `{{raw}}` | `v1.2.3rc2` |
|
||||||
| `1.2.3rc2` | `{{version}}` | | `1.2.3rc2` |
|
| `1.2.3rc2` | `{{version}}` | `1.2.3rc2` |
|
||||||
| `p1/v1.2.3` | `{{version}}` | `v(\d.\d.\d)$` | `1.2.3` |
|
| `1.2.3rc2` | `{{major}}.{{minor}}` | `1.2.3rc2`* |
|
||||||
| `1.2.3rc2` | `{{major}}.{{minor}}` | | `1.2.3rc2`* |
|
| `1.2.3post1` | `{{major}}.{{minor}}` | `1.2.3.post1`* |
|
||||||
| `1.2.3post1` | `{{major}}.{{minor}}` | | `1.2.3.post1`* |
|
| `1.2.3beta2` | `{{major}}.{{minor}}` | `1.2.3b2`* |
|
||||||
| `1.2.3beta2` | `{{major}}.{{minor}}` | | `1.2.3b2`* |
|
| `1.0dev4` | `{{major}}.{{minor}}` | `1.0.dev4`* |
|
||||||
| `1.0dev4` | `{{major}}.{{minor}}` | | `1.0.dev4`* |
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if
|
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if
|
||||||
> specified) as tag because they are updated frequently, and contain many
|
> specified) as tag because they are updated frequently, and contain many
|
||||||
> breaking changes that are (by the author's design) not yet fit for public
|
> breaking changes that are (by the author's design) not yet fit for public
|
||||||
@ -870,7 +858,6 @@ workflow run. Will be empty for a branch reference:
|
|||||||
| `push` | `refs/heads/my/branch` | |
|
| `push` | `refs/heads/my/branch` | |
|
||||||
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> *`base_ref` is available in the push payload but doesn't always seem to
|
> *`base_ref` is available in the push payload but doesn't always seem to
|
||||||
> return the expected branch when the push tag event occurs. It's also
|
> return the expected branch when the push tag event occurs. It's also
|
||||||
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
||||||
@ -882,11 +869,6 @@ workflow run. Will be empty for a branch reference:
|
|||||||
Returns `true` if the branch that triggered the workflow run is the default
|
Returns `true` if the branch that triggered the workflow run is the default
|
||||||
one, otherwise `false`.
|
one, otherwise `false`.
|
||||||
|
|
||||||
#### `{{is_not_default_branch}}`
|
|
||||||
|
|
||||||
Returns `true` if the branch that triggered the workflow run is not the default
|
|
||||||
one, otherwise `false`.
|
|
||||||
|
|
||||||
#### `{{date '<format>' tz='<timezone>'}}`
|
#### `{{date '<format>' tz='<timezone>'}}`
|
||||||
|
|
||||||
Returns the current date rendered by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
Returns the current date rendered by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||||
|
|||||||
@ -821,40 +821,6 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
],
|
],
|
||||||
undefined
|
undefined
|
||||||
],
|
|
||||||
[
|
|
||||||
'push22',
|
|
||||||
'event_push_dev.env',
|
|
||||||
{
|
|
||||||
images: ['org/app'],
|
|
||||||
tags: [
|
|
||||||
`type=edge,branch=master`,
|
|
||||||
`type=sha,format=long`,
|
|
||||||
`type=raw,value=notdefbranch,enable={{is_not_default_branch}}`
|
|
||||||
],
|
|
||||||
} as Inputs,
|
|
||||||
{
|
|
||||||
main: 'notdefbranch',
|
|
||||||
partial: [
|
|
||||||
'sha-860c1904a1ce19322e91ac35af1ab07466440c37'
|
|
||||||
],
|
|
||||||
latest: false
|
|
||||||
} as Version,
|
|
||||||
[
|
|
||||||
"org/app:notdefbranch",
|
|
||||||
"org/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
||||||
"org.opencontainers.image.description=This your first repo!",
|
|
||||||
"org.opencontainers.image.licenses=MIT",
|
|
||||||
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
|
||||||
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.title=Hello-World",
|
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.version=notdefbranch"
|
|
||||||
],
|
|
||||||
undefined
|
|
||||||
]
|
]
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@ -1971,69 +1937,6 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
],
|
],
|
||||||
undefined
|
undefined
|
||||||
],
|
|
||||||
[
|
|
||||||
'tag34',
|
|
||||||
'event_tag_p1-v1.0.0.env',
|
|
||||||
{
|
|
||||||
images: ['org/app'],
|
|
||||||
tags: [
|
|
||||||
`type=semver,pattern={{version}},"match=v(\\d.\\d.\\d)$"`,
|
|
||||||
]
|
|
||||||
} as Inputs,
|
|
||||||
{
|
|
||||||
main: '1.0.0',
|
|
||||||
partial: [],
|
|
||||||
latest: true
|
|
||||||
} as Version,
|
|
||||||
[
|
|
||||||
'org/app:1.0.0',
|
|
||||||
'org/app:latest'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
||||||
"org.opencontainers.image.description=This your first repo!",
|
|
||||||
"org.opencontainers.image.licenses=MIT",
|
|
||||||
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
|
||||||
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.title=Hello-World",
|
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.version=1.0.0"
|
|
||||||
],
|
|
||||||
undefined
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'push35',
|
|
||||||
'event_push_master.env',
|
|
||||||
{
|
|
||||||
images: ['user/app'],
|
|
||||||
tags: [
|
|
||||||
`type=semver,pattern={{version}},value=p1/v1.2.3,"match=v(\\d.\\d.\\d)$"`,
|
|
||||||
`type=pep440,pattern={{version}},value=p1/v1.2.3,"match=v(\\d.\\d.\\d)$"`,
|
|
||||||
`type=edge`
|
|
||||||
],
|
|
||||||
} as Inputs,
|
|
||||||
{
|
|
||||||
main: '1.2.3',
|
|
||||||
partial: ['edge'],
|
|
||||||
latest: true
|
|
||||||
} as Version,
|
|
||||||
[
|
|
||||||
'user/app:1.2.3',
|
|
||||||
'user/app:edge',
|
|
||||||
'user/app:latest'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
|
||||||
"org.opencontainers.image.description=This your first repo!",
|
|
||||||
"org.opencontainers.image.licenses=MIT",
|
|
||||||
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
|
||||||
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.title=Hello-World",
|
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
||||||
"org.opencontainers.image.version=1.2.3"
|
|
||||||
],
|
|
||||||
undefined
|
|
||||||
]
|
]
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@ -3936,12 +3839,6 @@ describe('json', () => {
|
|||||||
"user/app:custom",
|
"user/app:custom",
|
||||||
"user/app:tags"
|
"user/app:tags"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"dev",
|
|
||||||
"my",
|
|
||||||
"custom",
|
|
||||||
"tags"
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"foo": "",
|
"foo": "",
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
@ -3980,10 +3877,6 @@ describe('json', () => {
|
|||||||
"user/app:dev",
|
"user/app:dev",
|
||||||
"user/app:my",
|
"user/app:my",
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"dev",
|
|
||||||
"my",
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4027,13 +3920,6 @@ describe('json', () => {
|
|||||||
"user/app:tags",
|
"user/app:tags",
|
||||||
"user/app:latest"
|
"user/app:latest"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"release1",
|
|
||||||
"my",
|
|
||||||
"custom",
|
|
||||||
"tags",
|
|
||||||
"latest"
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4078,12 +3964,6 @@ describe('json', () => {
|
|||||||
"user/app:custom",
|
"user/app:custom",
|
||||||
"user/app:tags"
|
"user/app:tags"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"20200110",
|
|
||||||
"my",
|
|
||||||
"custom",
|
|
||||||
"tags"
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4137,15 +4017,6 @@ describe('json', () => {
|
|||||||
"ghcr.io/user/app:tags",
|
"ghcr.io/user/app:tags",
|
||||||
"ghcr.io/user/app:latest"
|
"ghcr.io/user/app:latest"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"1.1.1",
|
|
||||||
"1.1",
|
|
||||||
"1",
|
|
||||||
"my",
|
|
||||||
"custom",
|
|
||||||
"tags",
|
|
||||||
"latest",
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4188,11 +4059,6 @@ describe('json', () => {
|
|||||||
"ghcr.io/user/app:custom",
|
"ghcr.io/user/app:custom",
|
||||||
"ghcr.io/user/app:tags"
|
"ghcr.io/user/app:tags"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"my",
|
|
||||||
"custom",
|
|
||||||
"tags",
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
"org.opencontainers.image.description": "This your first repo!",
|
"org.opencontainers.image.description": "This your first repo!",
|
||||||
@ -4233,10 +4099,6 @@ describe('json', () => {
|
|||||||
"org/app:v1.1.1",
|
"org/app:v1.1.1",
|
||||||
"org/app:latest"
|
"org/app:latest"
|
||||||
],
|
],
|
||||||
"tag-names": [
|
|
||||||
"v1.1.1",
|
|
||||||
"latest"
|
|
||||||
],
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"maintainer": "CrazyMax",
|
"maintainer": "CrazyMax",
|
||||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||||
|
|||||||
@ -32,8 +32,7 @@ describe('transform', () => {
|
|||||||
"priority": DefaultPriorities[Type.Semver],
|
"priority": DefaultPriorities[Type.Semver],
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": "",
|
"value": ""
|
||||||
"match": ""
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -148,8 +147,7 @@ describe('parse', () => {
|
|||||||
"priority": DefaultPriorities[Type.Semver],
|
"priority": DefaultPriorities[Type.Semver],
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": "",
|
"value": ""
|
||||||
"match": ""
|
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
@ -162,8 +160,7 @@ describe('parse', () => {
|
|||||||
"priority": "1",
|
"priority": "1",
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": "",
|
"value": ""
|
||||||
"match": ""
|
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
@ -176,22 +173,7 @@ describe('parse', () => {
|
|||||||
"priority": "1",
|
"priority": "1",
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": "v1.0.0",
|
"value": "v1.0.0"
|
||||||
"match": ""
|
|
||||||
}
|
|
||||||
} as Tag,
|
|
||||||
false
|
|
||||||
],
|
|
||||||
[
|
|
||||||
`type=semver,priority=1,enable=true,pattern={{version}},value=p1/v1.0.0,"match=v(\\d.\\d.\\d)$"`,
|
|
||||||
{
|
|
||||||
type: Type.Semver,
|
|
||||||
attrs: {
|
|
||||||
"priority": "1",
|
|
||||||
"enable": "true",
|
|
||||||
"pattern": "{{version}}",
|
|
||||||
"value": "p1/v1.0.0",
|
|
||||||
"match": "v(\\d.\\d.\\d)$"
|
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
|
|||||||
@ -48,8 +48,6 @@ outputs:
|
|||||||
description: 'Generated Docker image version'
|
description: 'Generated Docker image version'
|
||||||
tags:
|
tags:
|
||||||
description: 'Generated Docker tags'
|
description: 'Generated Docker tags'
|
||||||
tag-names:
|
|
||||||
description: 'Generated Docker tag names without image base name'
|
|
||||||
labels:
|
labels:
|
||||||
description: 'Generated Docker labels'
|
description: 'Generated Docker labels'
|
||||||
annotations:
|
annotations:
|
||||||
|
|||||||
300
dist/606.index.js
generated
vendored
300
dist/606.index.js
generated
vendored
@ -1,300 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
exports.id = 606;
|
|
||||||
exports.ids = [606];
|
|
||||||
exports.modules = {
|
|
||||||
|
|
||||||
/***/ 606:
|
|
||||||
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
||||||
|
|
||||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
||||||
/* harmony export */ "default": () => (/* binding */ pMap)
|
|
||||||
/* harmony export */ });
|
|
||||||
/* unused harmony exports pMapIterable, pMapSkip */
|
|
||||||
async function pMap(
|
|
||||||
iterable,
|
|
||||||
mapper,
|
|
||||||
{
|
|
||||||
concurrency = Number.POSITIVE_INFINITY,
|
|
||||||
stopOnError = true,
|
|
||||||
signal,
|
|
||||||
} = {},
|
|
||||||
) {
|
|
||||||
return new Promise((resolve_, reject_) => {
|
|
||||||
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
|
||||||
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof mapper !== 'function') {
|
|
||||||
throw new TypeError('Mapper function is required');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
|
||||||
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = [];
|
|
||||||
const errors = [];
|
|
||||||
const skippedIndexesMap = new Map();
|
|
||||||
let isRejected = false;
|
|
||||||
let isResolved = false;
|
|
||||||
let isIterableDone = false;
|
|
||||||
let resolvingCount = 0;
|
|
||||||
let currentIndex = 0;
|
|
||||||
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
||||||
|
|
||||||
const signalListener = () => {
|
|
||||||
reject(signal.reason);
|
|
||||||
};
|
|
||||||
|
|
||||||
const cleanup = () => {
|
|
||||||
signal?.removeEventListener('abort', signalListener);
|
|
||||||
};
|
|
||||||
|
|
||||||
const resolve = value => {
|
|
||||||
resolve_(value);
|
|
||||||
cleanup();
|
|
||||||
};
|
|
||||||
|
|
||||||
const reject = reason => {
|
|
||||||
isRejected = true;
|
|
||||||
isResolved = true;
|
|
||||||
reject_(reason);
|
|
||||||
cleanup();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (signal) {
|
|
||||||
if (signal.aborted) {
|
|
||||||
reject(signal.reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
signal.addEventListener('abort', signalListener, {once: true});
|
|
||||||
}
|
|
||||||
|
|
||||||
const next = async () => {
|
|
||||||
if (isResolved) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const nextItem = await iterator.next();
|
|
||||||
|
|
||||||
const index = currentIndex;
|
|
||||||
currentIndex++;
|
|
||||||
|
|
||||||
// Note: `iterator.next()` can be called many times in parallel.
|
|
||||||
// This can cause multiple calls to this `next()` function to
|
|
||||||
// receive a `nextItem` with `done === true`.
|
|
||||||
// The shutdown logic that rejects/resolves must be protected
|
|
||||||
// so it runs only one time as the `skippedIndex` logic is
|
|
||||||
// non-idempotent.
|
|
||||||
if (nextItem.done) {
|
|
||||||
isIterableDone = true;
|
|
||||||
|
|
||||||
if (resolvingCount === 0 && !isResolved) {
|
|
||||||
if (!stopOnError && errors.length > 0) {
|
|
||||||
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isResolved = true;
|
|
||||||
|
|
||||||
if (skippedIndexesMap.size === 0) {
|
|
||||||
resolve(result);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pureResult = [];
|
|
||||||
|
|
||||||
// Support multiple `pMapSkip`'s.
|
|
||||||
for (const [index, value] of result.entries()) {
|
|
||||||
if (skippedIndexesMap.get(index) === pMapSkip) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
pureResult.push(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve(pureResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
resolvingCount++;
|
|
||||||
|
|
||||||
// Intentionally detached
|
|
||||||
(async () => {
|
|
||||||
try {
|
|
||||||
const element = await nextItem.value;
|
|
||||||
|
|
||||||
if (isResolved) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const value = await mapper(element, index);
|
|
||||||
|
|
||||||
// Use Map to stage the index of the element.
|
|
||||||
if (value === pMapSkip) {
|
|
||||||
skippedIndexesMap.set(index, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
result[index] = value;
|
|
||||||
|
|
||||||
resolvingCount--;
|
|
||||||
await next();
|
|
||||||
} catch (error) {
|
|
||||||
if (stopOnError) {
|
|
||||||
reject(error);
|
|
||||||
} else {
|
|
||||||
errors.push(error);
|
|
||||||
resolvingCount--;
|
|
||||||
|
|
||||||
// In that case we can't really continue regardless of `stopOnError` state
|
|
||||||
// since an iterable is likely to continue throwing after it throws once.
|
|
||||||
// If we continue calling `next()` indefinitely we will likely end up
|
|
||||||
// in an infinite loop of failed iteration.
|
|
||||||
try {
|
|
||||||
await next();
|
|
||||||
} catch (error) {
|
|
||||||
reject(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create the concurrent runners in a detached (non-awaited)
|
|
||||||
// promise. We need this so we can await the `next()` calls
|
|
||||||
// to stop creating runners before hitting the concurrency limit
|
|
||||||
// if the iterable has already been marked as done.
|
|
||||||
// NOTE: We *must* do this for async iterators otherwise we'll spin up
|
|
||||||
// infinite `next()` calls by default and never start the event loop.
|
|
||||||
(async () => {
|
|
||||||
for (let index = 0; index < concurrency; index++) {
|
|
||||||
try {
|
|
||||||
// eslint-disable-next-line no-await-in-loop
|
|
||||||
await next();
|
|
||||||
} catch (error) {
|
|
||||||
reject(error);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isIterableDone || isRejected) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function pMapIterable(
|
|
||||||
iterable,
|
|
||||||
mapper,
|
|
||||||
{
|
|
||||||
concurrency = Number.POSITIVE_INFINITY,
|
|
||||||
backpressure = concurrency,
|
|
||||||
} = {},
|
|
||||||
) {
|
|
||||||
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
|
||||||
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof mapper !== 'function') {
|
|
||||||
throw new TypeError('Mapper function is required');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
|
||||||
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
|
|
||||||
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
async * [Symbol.asyncIterator]() {
|
|
||||||
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
|
||||||
|
|
||||||
const promises = [];
|
|
||||||
let runningMappersCount = 0;
|
|
||||||
let isDone = false;
|
|
||||||
let index = 0;
|
|
||||||
|
|
||||||
function trySpawn() {
|
|
||||||
if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const promise = (async () => {
|
|
||||||
const {done, value} = await iterator.next();
|
|
||||||
|
|
||||||
if (done) {
|
|
||||||
return {done: true};
|
|
||||||
}
|
|
||||||
|
|
||||||
runningMappersCount++;
|
|
||||||
|
|
||||||
// Spawn if still below concurrency and backpressure limit
|
|
||||||
trySpawn();
|
|
||||||
|
|
||||||
try {
|
|
||||||
const returnValue = await mapper(await value, index++);
|
|
||||||
|
|
||||||
runningMappersCount--;
|
|
||||||
|
|
||||||
if (returnValue === pMapSkip) {
|
|
||||||
const index = promises.indexOf(promise);
|
|
||||||
|
|
||||||
if (index > 0) {
|
|
||||||
promises.splice(index, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spawn if still below backpressure limit and just dropped below concurrency limit
|
|
||||||
trySpawn();
|
|
||||||
|
|
||||||
return {done: false, value: returnValue};
|
|
||||||
} catch (error) {
|
|
||||||
isDone = true;
|
|
||||||
return {error};
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
promises.push(promise);
|
|
||||||
}
|
|
||||||
|
|
||||||
trySpawn();
|
|
||||||
|
|
||||||
while (promises.length > 0) {
|
|
||||||
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
|
|
||||||
|
|
||||||
promises.shift();
|
|
||||||
|
|
||||||
if (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (done) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spawn if just dropped below backpressure limit and below the concurrency limit
|
|
||||||
trySpawn();
|
|
||||||
|
|
||||||
if (value === pMapSkip) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
yield value;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const pMapSkip = Symbol('skip');
|
|
||||||
|
|
||||||
|
|
||||||
/***/ })
|
|
||||||
|
|
||||||
};
|
|
||||||
;
|
|
||||||
//# sourceMappingURL=606.index.js.map
|
|
||||||
1
dist/606.index.js.map
generated
vendored
1
dist/606.index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
96
dist/index.js
generated
vendored
96
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
4045
dist/licenses.txt
generated
vendored
4045
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
39
package.json
39
package.json
@ -25,33 +25,34 @@
|
|||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"packageManager": "yarn@4.9.2",
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/github": "^6.0.1",
|
"@actions/github": "^6.0.0",
|
||||||
"@docker/actions-toolkit": "^0.68.0",
|
"@docker/actions-toolkit": "^0.56.0",
|
||||||
"@renovate/pep440": "^1.0.0",
|
"@renovate/pep440": "^1.0.0",
|
||||||
"csv-parse": "^6.1.0",
|
"csv-parse": "^5.6.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"moment-timezone": "^0.6.0",
|
"moment-timezone": "^0.5.47",
|
||||||
"semver": "^7.7.3"
|
"semver": "^7.7.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.19.9",
|
"@types/csv-parse": "^1.2.2",
|
||||||
"@types/semver": "^7.7.1",
|
"@types/node": "^20.12.12",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
"@types/semver": "^7.5.8",
|
||||||
"@typescript-eslint/parser": "^7.18.0",
|
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
||||||
"@vercel/ncc": "^0.38.3",
|
"@typescript-eslint/parser": "^7.9.0",
|
||||||
"dotenv": "^16.6.1",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"eslint": "^8.57.1",
|
"dotenv": "^16.4.5",
|
||||||
"eslint-config-prettier": "^9.1.2",
|
"eslint": "^8.57.0",
|
||||||
"eslint-plugin-jest": "^28.14.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^5.5.4",
|
"eslint-plugin-jest": "^28.5.0",
|
||||||
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.4.1",
|
"ts-jest": "^29.1.2",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^5.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ actionsToolkit.run(
|
|||||||
setOutput('version', version.main || '');
|
setOutput('version', version.main || '');
|
||||||
|
|
||||||
// Docker tags
|
// Docker tags
|
||||||
const tags = meta.getTags();
|
const tags: Array<string> = meta.getTags();
|
||||||
if (tags.length == 0) {
|
if (tags.length == 0) {
|
||||||
core.warning('No Docker tag has been generated. Check tags input.');
|
core.warning('No Docker tag has been generated. Check tags input.');
|
||||||
} else {
|
} else {
|
||||||
@ -58,7 +58,6 @@ actionsToolkit.run(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
setOutput('tags', tags.join(inputs.sepTags));
|
setOutput('tags', tags.join(inputs.sepTags));
|
||||||
setOutput('tag-names', meta.getTags(true).join(inputs.sepTags));
|
|
||||||
|
|
||||||
// Docker labels
|
// Docker labels
|
||||||
const labels: Array<string> = meta.getLabels();
|
const labels: Array<string> = meta.getLabels();
|
||||||
|
|||||||
70
src/meta.ts
70
src/meta.ts
@ -161,20 +161,8 @@ export class Meta {
|
|||||||
if (tag.attrs['value'].length > 0) {
|
if (tag.attrs['value'].length > 0) {
|
||||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||||
} else {
|
} else {
|
||||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '');
|
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag.attrs['match'].length > 0) {
|
|
||||||
const tmatch = vraw.match(tag.attrs['match']);
|
|
||||||
if (!tmatch) {
|
|
||||||
core.warning(`${tag.attrs['match']} does not match ${vraw}.`);
|
|
||||||
} else {
|
|
||||||
vraw = tmatch[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vraw = vraw.replace(/\//g, '-');
|
|
||||||
|
|
||||||
if (!semver.valid(vraw)) {
|
if (!semver.valid(vraw)) {
|
||||||
core.warning(`${vraw} is not a valid semver. More info: https://semver.org/`);
|
core.warning(`${vraw} is not a valid semver. More info: https://semver.org/`);
|
||||||
return version;
|
return version;
|
||||||
@ -207,20 +195,8 @@ export class Meta {
|
|||||||
if (tag.attrs['value'].length > 0) {
|
if (tag.attrs['value'].length > 0) {
|
||||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||||
} else {
|
} else {
|
||||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '');
|
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag.attrs['match'].length > 0) {
|
|
||||||
const tmatch = vraw.match(tag.attrs['match']);
|
|
||||||
if (!tmatch) {
|
|
||||||
core.warning(`${tag.attrs['match']} does not match ${vraw}.`);
|
|
||||||
} else {
|
|
||||||
vraw = tmatch[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vraw = vraw.replace(/\//g, '-');
|
|
||||||
|
|
||||||
if (!pep440.valid(vraw)) {
|
if (!pep440.valid(vraw)) {
|
||||||
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
||||||
return version;
|
return version;
|
||||||
@ -463,9 +439,6 @@ export class Meta {
|
|||||||
}
|
}
|
||||||
return 'false';
|
return 'false';
|
||||||
},
|
},
|
||||||
is_not_default_branch: function () {
|
|
||||||
return this.is_default_branch() === 'false' ? 'true' : 'false';
|
|
||||||
},
|
|
||||||
date: function (format, options) {
|
date: function (format, options) {
|
||||||
const m = moment(currentDate);
|
const m = moment(currentDate);
|
||||||
let tz = 'UTC';
|
let tz = 'UTC';
|
||||||
@ -494,37 +467,33 @@ export class Meta {
|
|||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTags(namesOnly?: boolean): Array<string> {
|
public getTags(): Array<string> {
|
||||||
if (!this.version.main) {
|
if (!this.version.main) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
if (namesOnly) {
|
|
||||||
return this.generateTags(this.version.main);
|
const generateTags = (imageName: string, version: string): Array<string> => {
|
||||||
}
|
const tags: Array<string> = [];
|
||||||
|
const prefix = imageName !== '' ? `${imageName}:` : '';
|
||||||
|
tags.push(`${prefix}${version}`);
|
||||||
|
for (const partial of this.version.partial) {
|
||||||
|
tags.push(`${prefix}${partial}`);
|
||||||
|
}
|
||||||
|
if (this.version.latest) {
|
||||||
|
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
|
||||||
|
tags.push(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
||||||
|
}
|
||||||
|
return tags;
|
||||||
|
};
|
||||||
|
|
||||||
const tags: Array<string> = [];
|
const tags: Array<string> = [];
|
||||||
const images = this.getImageNames();
|
const images = this.getImageNames();
|
||||||
if (images.length > 0) {
|
if (images.length > 0) {
|
||||||
for (const imageName of images) {
|
for (const imageName of images) {
|
||||||
tags.push(...this.generateTags(this.version.main, imageName));
|
tags.push(...generateTags(imageName, this.version.main));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tags.push(...this.generateTags(this.version.main));
|
tags.push(...generateTags('', this.version.main));
|
||||||
}
|
|
||||||
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
private generateTags(version: string, imageName?: string): Array<string> {
|
|
||||||
const tags: Array<string> = [];
|
|
||||||
const prefix = imageName ? `${imageName}:` : '';
|
|
||||||
tags.push(`${prefix}${version}`);
|
|
||||||
for (const partial of this.version.partial) {
|
|
||||||
tags.push(`${prefix}${partial}`);
|
|
||||||
}
|
|
||||||
if (this.version.latest) {
|
|
||||||
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
|
|
||||||
tags.push(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
@ -572,7 +541,6 @@ export class Meta {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
'tag-names': this.getTags(true),
|
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
|
|||||||
@ -104,10 +104,10 @@ export function Parse(s: string): Tag {
|
|||||||
const value = parts[1];
|
const value = parts[1];
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'type': {
|
case 'type': {
|
||||||
if (!Object.values(Type).includes(value as Type)) {
|
if (!Object.values(Type).includes(value)) {
|
||||||
throw new Error(`Unknown tag type attribute: ${value}`);
|
throw new Error(`Unknown tag type attribute: ${value}`);
|
||||||
}
|
}
|
||||||
tag.type = value as Type;
|
tag.type = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -137,9 +137,6 @@ export function Parse(s: string): Tag {
|
|||||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'value')) {
|
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'value')) {
|
||||||
tag.attrs['value'] = '';
|
tag.attrs['value'] = '';
|
||||||
}
|
}
|
||||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'match')) {
|
|
||||||
tag.attrs['match'] = '';
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Type.Match: {
|
case Type.Match: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user