Compare commits
341
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
030e881283 | ||
|
|
4b529ac4e5 | ||
|
|
b0082b33bc | ||
|
|
7b19fec715 | ||
|
|
281c9b0599 | ||
|
|
5f43b3b4f4 | ||
|
|
9d53276575 | ||
|
|
eaa3d3973e | ||
|
|
6b695f7a8a | ||
|
|
a1afadcb28 | ||
|
|
c769610e5c | ||
|
|
f0f930b111 | ||
|
|
f4771c2b1f | ||
|
|
538feedf47 | ||
|
|
2c6e6d9d3b | ||
|
|
8fd476a5a7 | ||
|
|
a33d385eb1 | ||
|
|
cb50be4508 | ||
|
|
8fd95d6f08 | ||
|
|
a4e219a90d | ||
|
|
76c27c49eb | ||
|
|
1ea5d4f1b0 | ||
|
|
91c3fe061e | ||
|
|
f332e46fa5 | ||
|
|
51b601f22d | ||
|
|
8480620af8 | ||
|
|
8e71445576 | ||
|
|
f57c915b64 | ||
|
|
d92a8d0b86 | ||
|
|
cf6a6ce0f7 | ||
|
|
d5be006250 | ||
|
|
a60f0f62b5 | ||
|
|
10f4f1aaa5 | ||
|
|
70c914a6f8 | ||
|
|
ed95091677 | ||
|
|
57670b6268 | ||
|
|
d636a41a2f | ||
|
|
9c747a7ed1 | ||
|
|
c98baa7757 | ||
|
|
ad1f8b1f99 | ||
|
|
f0a4bc3c2d | ||
|
|
9b6cf6ec37 | ||
|
|
c299e40c65 | ||
|
|
f015d7914a | ||
|
|
121bcc2ca8 | ||
|
|
f7b6bf41b9 | ||
|
|
0b95c6b860 | ||
|
|
17f70d7525 | ||
|
|
afd7e6d7bb | ||
|
|
602aff8e11 | ||
|
|
aecb1a49a5 | ||
|
|
8d8c7c12f7 | ||
|
|
15bd03a177 | ||
|
|
fdba5868fb | ||
|
|
318604b99e | ||
|
|
49c0a55d55 | ||
|
|
486229e3f4 | ||
|
|
f02aeab1ee | ||
|
|
beafb97305 | ||
|
|
3ff819c6c5 | ||
|
|
05838e9769 | ||
|
|
43fa4ac0d3 | ||
|
|
b3120f2f18 | ||
|
|
1f469d21ee | ||
|
|
b0a2bcfe7b | ||
|
|
14973dfd4b | ||
|
|
dae123c2bf | ||
|
|
fdb90a51ae | ||
|
|
e5afe339d8 | ||
|
|
17e37c2a42 | ||
|
|
aa0be5b84c | ||
|
|
136a4a23fe | ||
|
|
5f9eb12581 | ||
|
|
be25a4ce07 | ||
|
|
eced061233 | ||
|
|
e7f20f98b1 | ||
|
|
95bdd37b1f | ||
|
|
3fb4efdf45 | ||
|
|
f31cd74edd | ||
|
|
840a42f4cf | ||
|
|
ada8aa8ca0 | ||
|
|
3fa6bb33cb | ||
|
|
8aa9733355 | ||
|
|
d87caff40c | ||
|
|
83e4951424 | ||
|
|
9efc8723fe | ||
|
|
ec2c9a30cf | ||
|
|
e427fa1e40 | ||
|
|
032a4b3bda | ||
|
|
06e11bf926 | ||
|
|
c1e51972af | ||
|
|
89dd65a569 | ||
|
|
699ee45cf1 | ||
|
|
e0542a6360 | ||
|
|
b7facdfcef | ||
|
|
81c60dfb8b | ||
|
|
de1119515d | ||
|
|
2f9c64b1b1 | ||
|
|
510f746975 | ||
|
|
2bc3f4e0f1 | ||
|
|
f0cfcb57f6 | ||
|
|
be19121bfd | ||
|
|
c1eb0314a3 | ||
|
|
b798ed8388 | ||
|
|
07d42e0b4f | ||
|
|
495d5ce528 | ||
|
|
54b10fa1b6 | ||
|
|
c49a1eee09 | ||
|
|
f37a3b6e88 | ||
|
|
85eb7c9324 | ||
|
|
a1c21022b0 | ||
|
|
6547919405 | ||
|
|
2e80e58e70 | ||
|
|
a51254e5fa | ||
|
|
dee3324b00 | ||
|
|
418e4b98bf | ||
|
|
e8ece87dc8 | ||
|
|
12d9b9a905 | ||
|
|
c88acc31ec | ||
|
|
902fa8ec7d | ||
|
|
c30b9c27e6 | ||
|
|
0698804aab | ||
|
|
bb3eecaaf8 | ||
|
|
94a839cf6a | ||
|
|
ecd51a0f6a | ||
|
|
a85b1dbfe6 | ||
|
|
5a76a0efcf | ||
|
|
1cc4a9856a | ||
|
|
d84de1e022 | ||
|
|
092f0474e9 | ||
|
|
8b68062745 | ||
|
|
0eaca2ee4e | ||
|
|
db44dfae7a | ||
|
|
2bd8a81e96 | ||
|
|
10ff2155d8 | ||
|
|
a1a78f1e24 | ||
|
|
95438bc6e5 | ||
|
|
0e4a06e6a2 | ||
|
|
a550435c60 | ||
|
|
b539e14bf6 | ||
|
|
d931b83008 | ||
|
|
8e1d5461f0 | ||
|
|
2af3007824 | ||
|
|
0d820067b8 | ||
|
|
906ecf0fc0 | ||
|
|
f78c299c14 | ||
|
|
87ff116aea | ||
|
|
b53be03109 | ||
|
|
3da9c47fb9 | ||
|
|
f5d655ce8b | ||
|
|
369eb591f4 | ||
|
|
7d870ce854 | ||
|
|
e44a9cd788 | ||
|
|
8cb0002d6a | ||
|
|
e01ddd3e3c | ||
|
|
861d98a3bd | ||
|
|
359e915ab3 | ||
|
|
0c395ebe62 | ||
|
|
115662203e | ||
|
|
95ea8d0c40 | ||
|
|
a4c10ad2ed | ||
|
|
c85c22ab59 | ||
|
|
526d40319b | ||
|
|
86622a92ee | ||
|
|
44d81d6d2a | ||
|
|
9aaeb628e0 | ||
|
|
32323e53fe | ||
|
|
3d8d1d9406 | ||
|
|
1b250aecdc | ||
|
|
bd26c982ee | ||
|
|
f574002aaf | ||
|
|
30c2f0a1f0 | ||
|
|
0de3687b53 | ||
|
|
3229e62531 | ||
|
|
f829da7245 | ||
|
|
9b90a2e882 | ||
|
|
aa662cf9eb | ||
|
|
c6cb763bee | ||
|
|
bb9c6dd583 | ||
|
|
d31acd5065 | ||
|
|
6df88e4e75 | ||
|
|
70b2cdc648 | ||
|
|
1a52488bd8 | ||
|
|
60a0d343a0 | ||
|
|
b3bc5a6d84 | ||
|
|
e6e95c28a4 | ||
|
|
9ec63a7555 | ||
|
|
6970301b80 | ||
|
|
d155f767a3 | ||
|
|
b5b2c1dec6 | ||
|
|
a64d0487d7 | ||
|
|
68e4cac93d | ||
|
|
7ba3606742 | ||
|
|
2331fdf258 | ||
|
|
24ce540669 | ||
|
|
d729db4f91 | ||
|
|
f7b4ed1238 | ||
|
|
33c4e25305 | ||
|
|
b83177b368 | ||
|
|
839b70f9d5 | ||
|
|
dbacb9a831 | ||
|
|
247cc9691a | ||
|
|
4c92c35ca9 | ||
|
|
9ca1efb941 | ||
|
|
0170173c39 | ||
|
|
dab39f1537 | ||
|
|
f402fd6ae4 | ||
|
|
b0bbce7f66 | ||
|
|
2ee3d3070b | ||
|
|
6e3a986a06 | ||
|
|
4fde7ad49c | ||
|
|
24b670ad98 | ||
|
|
1294d94f8e | ||
|
|
4ab8e580e1 | ||
|
|
3617daf484 | ||
|
|
b5cd5676d4 | ||
|
|
204ddf0626 | ||
|
|
588ab464f7 | ||
|
|
6ed49e6282 | ||
|
|
499da83ec1 | ||
|
|
1bc39885c1 | ||
|
|
c314eea2b2 | ||
|
|
22d80c023d | ||
|
|
38b3677383 | ||
|
|
3c91de3093 | ||
|
|
75359341f6 | ||
|
|
2432cf717c | ||
|
|
c77859c8ba | ||
|
|
60ab7b421c | ||
|
|
7ce1a14667 | ||
|
|
d06e52bc52 | ||
|
|
66f0185bb8 | ||
|
|
232fc64e3a | ||
|
|
1b08479748 | ||
|
|
3a28db68be | ||
|
|
6bb43c8680 | ||
|
|
41050ffe08 | ||
|
|
8e5442c4ef | ||
|
|
eda41b71bf | ||
|
|
388c08f740 | ||
|
|
dbef88086f | ||
|
|
b73e7a71ac | ||
|
|
b9fba690eb | ||
|
|
ac82374ba6 | ||
|
|
c92519a44e | ||
|
|
3b4179d34d | ||
|
|
0784993ef8 | ||
|
|
52c3e9e410 | ||
|
|
82a5e6726c | ||
|
|
41e1fe3437 | ||
|
|
48cce1cba0 | ||
|
|
61879b94bc | ||
|
|
36ea4ee555 | ||
|
|
74fa878183 | ||
|
|
9dc751fe24 | ||
|
|
c94c54c4e6 | ||
|
|
187f09259d | ||
|
|
6d6eaf3451 | ||
|
|
1484a7ec95 | ||
|
|
31cebacef4 | ||
|
|
394bbab10c | ||
|
|
ee4c9054ec | ||
|
|
e6428a5c4e | ||
|
|
26b4721af7 | ||
|
|
352ce8b7fe | ||
|
|
cb0becceaf | ||
|
|
91224bc155 | ||
|
|
f19c3691d5 | ||
|
|
4066f0cede | ||
|
|
d6a296c454 | ||
|
|
aacea38e07 | ||
|
|
051f7ea71b | ||
|
|
2fc083a3a4 | ||
|
|
488568d6fa | ||
|
|
f33ad1e20d | ||
|
|
6bbe00c7bc | ||
|
|
f0ad8701de | ||
|
|
2a4836ac76 | ||
|
|
9bdb15d11e | ||
|
|
b94479639a | ||
|
|
f3c3cad8ad | ||
|
|
3b632771f9 | ||
|
|
62339db73c | ||
|
|
f13510ee59 | ||
|
|
6796a85d36 | ||
|
|
1ec392100e | ||
|
|
15f2689f92 | ||
|
|
ad9adab519 | ||
|
|
28aeae210e | ||
|
|
5f160a25bd | ||
|
|
05d3089a30 | ||
|
|
b8c52fa5a7 | ||
|
|
fa851f2008 | ||
|
|
879dcbb708 | ||
|
|
167d566053 | ||
|
|
6dfb6f1404 | ||
|
|
62a438bd07 | ||
|
|
ee5ff41fc8 | ||
|
|
c0f15f0bfe | ||
|
|
2c2bddef07 | ||
|
|
00dcdd5da5 | ||
|
|
bd87541fe8 | ||
|
|
b87668a573 | ||
|
|
407b95c632 | ||
|
|
0668f8e3c4 | ||
|
|
d0efd7f63f | ||
|
|
672cd7b637 | ||
|
|
1f35ebc704 | ||
|
|
413e9a9a6a | ||
|
|
96383f4557 | ||
|
|
f138b9677b | ||
|
|
9cf7015b15 | ||
|
|
5a8a5ff8df | ||
|
|
2279d9af58 | ||
|
|
c659933213 | ||
|
|
48d23ccc05 | ||
|
|
b83ffb48d6 | ||
|
|
3207f2405f | ||
|
|
63f4a263e5 | ||
|
|
547dcd6d67 | ||
|
|
450eef4207 | ||
|
|
903f5af663 | ||
|
|
3634bd57d7 | ||
|
|
d3faf0d1af | ||
|
|
ff376f4737 | ||
|
|
79f06a31c0 | ||
|
|
6f69513dab | ||
|
|
b67fef219a | ||
|
|
51990f24d1 | ||
|
|
4af6ba2231 | ||
|
|
59de4866c5 | ||
|
|
0f8c876baf | ||
|
|
389ff6bdd5 | ||
|
|
2bcfca25d5 | ||
|
|
05b244eb76 | ||
|
|
35e9aff4f5 | ||
|
|
1586898b63 | ||
|
|
7a273586e1 | ||
|
|
ef25336f42 | ||
|
|
0ab15faee8 | ||
|
|
1ea1b02f9b |
No files matched your search
+11
-1
@@ -1,2 +1,12 @@
|
||||
/coverage
|
||||
/node_modules
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2021": true,
|
||||
"jest/globals": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jest",
|
||||
"prettier"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/__tests__/fixtures/** -linguist-detectable
|
||||
/dist/** linguist-generated=true
|
||||
/lib/** linguist-generated=true
|
||||
@@ -1 +0,0 @@
|
||||
* @crazy-max
|
||||
@@ -0,0 +1,3 @@
|
||||
# Code of conduct
|
||||
|
||||
- [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines)
|
||||
@@ -0,0 +1,101 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Bug Report
|
||||
description: Report a bug
|
||||
labels:
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thank you for taking the time to report a bug!
|
||||
If this is a security issue please report it to the [Docker Security team](mailto:security@docker.com).
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Contributing guidelines
|
||||
description: >
|
||||
Make sure you've read the contributing guidelines before proceeding.
|
||||
options:
|
||||
- label: I've read the [contributing guidelines](https://github.com/docker/metadata-action/blob/master/.github/CONTRIBUTING.md) and wholeheartedly agree
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: "I've found a bug, and:"
|
||||
description: |
|
||||
Make sure that your request fulfills all of the following requirements.
|
||||
If one requirement cannot be satisfied, explain in detail why.
|
||||
options:
|
||||
- label: The documentation does not mention anything about my problem
|
||||
- label: There are no open or closed issues that are related to my problem
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Description
|
||||
description: >
|
||||
Provide a brief description of the bug in 1-2 sentences.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
description: >
|
||||
Describe precisely what you'd expect to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual behaviour
|
||||
description: >
|
||||
Describe precisely what is actually happening.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Repository URL
|
||||
description: >
|
||||
Enter the URL of the repository where you are experiencing the
|
||||
issue. If your repository is private, provide a link to a minimal
|
||||
repository that reproduces the issue.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: Workflow run URL
|
||||
description: >
|
||||
Enter the URL of the GitHub Action workflow run if public (e.g.
|
||||
`https://github.com/<user>/<repo>/actions/runs/<id>`)
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: YAML workflow
|
||||
description: |
|
||||
Provide the YAML of the workflow that's causing the issue.
|
||||
Make sure to remove any sensitive information.
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Workflow logs
|
||||
description: >
|
||||
[Attach](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/attaching-files)
|
||||
the [log file of your workflow run](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
|
||||
and make sure to remove any sensitive information.
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: BuildKit logs
|
||||
description: >
|
||||
If applicable, provide the [BuildKit container logs](https://docs.docker.com/build/ci/github-actions/configure-builder/#buildkit-container-logs)
|
||||
render: text
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional info
|
||||
description: |
|
||||
Provide any additional information that could be useful.
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
---
|
||||
|
||||
### Behaviour
|
||||
|
||||
#### Steps to reproduce this issue
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
#### Expected behaviour
|
||||
|
||||
> Tell us what should happen
|
||||
|
||||
#### Actual behaviour
|
||||
|
||||
> Tell us what happens instead
|
||||
|
||||
### Configuration
|
||||
|
||||
* Repository URL (if public):
|
||||
* Build URL (if public):
|
||||
|
||||
```yml
|
||||
# paste your YAML workflow file here and remove sensitive data
|
||||
```
|
||||
|
||||
### Logs
|
||||
|
||||
> Download the [log file of your build](https://docs.github.com/en/actions/managing-workflow-runs/using-workflow-run-logs#downloading-logs)
|
||||
> and [attach it](https://docs.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests) to this issue.
|
||||
@@ -0,0 +1,9 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Questions and Discussions
|
||||
url: https://github.com/docker/metadata-action/discussions/new
|
||||
about: Use Github Discussions to ask questions and/or open discussion topics.
|
||||
- name: Documentation
|
||||
url: https://docs.docker.com/build/ci/github-actions/
|
||||
about: Read the documentation.
|
||||
@@ -0,0 +1,15 @@
|
||||
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
|
||||
name: Feature request
|
||||
description: Missing functionality? Come tell us about it!
|
||||
labels:
|
||||
- kind/enhancement
|
||||
- status/triage
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: What is the feature you want to see?
|
||||
validations:
|
||||
required: true
|
||||
@@ -0,0 +1,12 @@
|
||||
# Reporting security issues
|
||||
|
||||
The project maintainers take security seriously. If you discover a security
|
||||
issue, please bring it to their attention right away!
|
||||
|
||||
**Please _DO NOT_ file a public issue**, instead send your report privately to
|
||||
[security@docker.com](mailto:security@docker.com).
|
||||
|
||||
Security reports are greatly appreciated, and we will publicly thank you for it.
|
||||
We also like to send gifts—if you'd like Docker swag, make sure to let
|
||||
us know. We currently do not offer a paid security bounty program, but are not
|
||||
ruling it out in the future.
|
||||
@@ -1,32 +0,0 @@
|
||||
# Support [](https://isitmaintained.com/project/docker/metadata-action)
|
||||
|
||||
## Reporting an issue
|
||||
|
||||
Please do a search in [open issues](https://github.com/docker/metadata-action/issues?utf8=%E2%9C%93&q=) to see if the
|
||||
issue or feature request has already been filed.
|
||||
|
||||
If you find your issue already exists, make relevant comments and add your
|
||||
[reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place
|
||||
of a "+1" comment.
|
||||
|
||||
:+1: - upvote
|
||||
|
||||
:-1: - downvote
|
||||
|
||||
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
|
||||
|
||||
## Writing good bug reports and feature requests
|
||||
|
||||
File a single issue per problem and feature request.
|
||||
|
||||
* Do not enumerate multiple bugs or feature requests in the same issue.
|
||||
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
|
||||
|
||||
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
|
||||
|
||||
You are now ready to [create a new issue](https://github.com/docker/metadata-action/issues/new/choose)!
|
||||
|
||||
## Closure policy
|
||||
|
||||
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
|
||||
* Issues that go a week without a response from original poster are subject to closure at our discretion.
|
||||
@@ -11,6 +11,7 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
versioning-strategy: "increase"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
labels:
|
||||
|
||||
+291
-37
@@ -1,5 +1,9 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * *'
|
||||
@@ -13,14 +17,39 @@ on:
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE: localhost:5000/name/app
|
||||
BUILDX_VERSION: latest
|
||||
|
||||
jobs:
|
||||
context:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
context:
|
||||
- workflow
|
||||
- git
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
context: ${{ matrix.context }}
|
||||
|
||||
multi-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -51,7 +80,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -81,7 +116,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -109,7 +150,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -134,7 +181,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -151,7 +204,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -161,12 +220,18 @@ jobs:
|
||||
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
||||
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
labels:
|
||||
custom-labels-annotations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -179,13 +244,24 @@ jobs:
|
||||
org.opencontainers.image.title=MyCustomTitle
|
||||
org.opencontainers.image.description=this is a "good" example
|
||||
org.opencontainers.image.vendor=MyCompany
|
||||
annotations: |
|
||||
maintainer=Foo
|
||||
org.opencontainers.image.title=MyFooTitle
|
||||
org.opencontainers.image.description=this is a "foo" example
|
||||
org.opencontainers.image.vendor=MyFooCompany
|
||||
|
||||
global-exps:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@@ -193,6 +269,8 @@ jobs:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
labels: |
|
||||
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
||||
tags: |
|
||||
type=sha
|
||||
type=raw,value=gexp-branch-{{branch}}
|
||||
@@ -200,13 +278,20 @@ jobs:
|
||||
type=raw,value=gexp-tag-{{tag}}
|
||||
type=raw,value=gexp-baseref-{{base_ref}}
|
||||
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
||||
type=raw,value=gexp-notdefbranch,enable={{is_not_default_branch}}
|
||||
|
||||
json:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@@ -235,7 +320,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
@@ -252,17 +343,9 @@ jobs:
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Build and push to local registry
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./test
|
||||
file: ./test/Dockerfile
|
||||
@@ -279,17 +362,18 @@ jobs:
|
||||
name: Check manifest
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
||||
-
|
||||
name: Dump context
|
||||
if: always()
|
||||
uses: crazy-max/ghaction-dump-context@v2
|
||||
|
||||
bake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
@@ -307,19 +391,14 @@ jobs:
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v3
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
${{ steps.docker_meta.outputs.bake-file }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
@@ -334,7 +413,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@@ -346,7 +431,7 @@ jobs:
|
||||
sep-tags: ${{ matrix.sep }}
|
||||
-
|
||||
name: Tags
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||
@@ -356,7 +441,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@@ -367,9 +458,11 @@ jobs:
|
||||
ghcr.io/name/app
|
||||
labels: |
|
||||
maintainer=CrazyMax
|
||||
annotations: |
|
||||
maintainer=Foo
|
||||
-
|
||||
name: Build
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./test
|
||||
file: ./test/output.Dockerfile
|
||||
@@ -377,4 +470,165 @@ jobs:
|
||||
DOCKER_METADATA_OUTPUT_VERSION
|
||||
DOCKER_METADATA_OUTPUT_TAGS
|
||||
DOCKER_METADATA_OUTPUT_LABELS
|
||||
DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||
DOCKER_METADATA_OUTPUT_JSON
|
||||
|
||||
no-output-env:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_METADATA_SET_OUTPUT_ENV: false
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
labels: |
|
||||
maintainer=CrazyMax
|
||||
annotations: |
|
||||
maintainer=Foo
|
||||
-
|
||||
name: No output environment variables set
|
||||
shell: bash
|
||||
run: |
|
||||
[[ "$(printenv | grep "^DOCKER_METADATA_OUTPUT_" | wc -l)" -eq 0 ]] || exit 1
|
||||
|
||||
bake-annotations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
type=sha
|
||||
env:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-annotations }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
no-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
-
|
||||
name: Print envs
|
||||
run: env|sort
|
||||
|
||||
bake-path-context:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: latest
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: ./
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: .
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
sha-short:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
short-length:
|
||||
- ''
|
||||
- 16
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
ghcr.io/name/app
|
||||
tags: |
|
||||
type=sha
|
||||
env:
|
||||
DOCKER_METADATA_SHORT_SHA_LENGTH: ${{ matrix.short-length }}
|
||||
|
||||
dump:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Dump context
|
||||
uses: crazy-max/ghaction-dump-context@v2
|
||||
@@ -0,0 +1,17 @@
|
||||
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
|
||||
@@ -0,0 +1,21 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
packages: write
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
||||
@@ -1,5 +1,9 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -13,14 +17,16 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v3
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: .
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
file: ./coverage/clover.xml
|
||||
files: ./coverage/clover.xml
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
@@ -0,0 +1,49 @@
|
||||
name: update-dist
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
update-dist:
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: GitHub auth token from GitHub App
|
||||
id: docker-read-app
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
|
||||
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
|
||||
owner: docker
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
fetch-depth: 0
|
||||
token: ${{ steps.docker-read-app.outputs.token || github.token }}
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
source: .
|
||||
targets: build
|
||||
-
|
||||
name: Commit and push dist
|
||||
run: |
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
(
|
||||
set -x
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add dist
|
||||
git commit -m "chore: update generated content"
|
||||
git push
|
||||
)
|
||||
else
|
||||
echo "No changes in dist"
|
||||
fi
|
||||
@@ -1,5 +1,9 @@
|
||||
name: validate
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
@@ -11,16 +15,17 @@ jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
targets: ${{ steps.targets.outputs.matrix }}
|
||||
targets: ${{ steps.generate.outputs.targets }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Targets matrix
|
||||
id: targets
|
||||
run: |
|
||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
||||
name: List targets
|
||||
id: generate
|
||||
uses: docker/bake-action/subaction/list-targets@v6
|
||||
with:
|
||||
target: validate
|
||||
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -31,11 +36,8 @@ jobs:
|
||||
matrix:
|
||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v3
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
+14
-57
@@ -1,12 +1,5 @@
|
||||
/.dev
|
||||
node_modules/
|
||||
lib
|
||||
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@@ -24,34 +18,14 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
@@ -61,36 +35,19 @@ typings/
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.test
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
@@ -0,0 +1,6 @@
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/
|
||||
+1
-2
@@ -6,6 +6,5 @@
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": false,
|
||||
"arrowParens": "avoid",
|
||||
"parser": "typescript"
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
# https://yarnpkg.com/configuration/yarnrc
|
||||
|
||||
compressionLevel: mixed
|
||||
enableGlobalCache: false
|
||||
enableHardenedMode: true
|
||||
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
- code: YN0086
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
@@ -44,10 +44,13 @@ ___
|
||||
* [`{{sha}}`](#sha)
|
||||
* [`{{base_ref}}`](#base_ref)
|
||||
* [`{{is_default_branch}}`](#is_default_branch)
|
||||
* [`{{is_not_default_branch}}`](#is_not_default_branch)
|
||||
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
||||
* [`{{commit_date '<format>' tz='<timezone>'}}`](#commit_date-format-tztimezone)
|
||||
* [Major version zero](#major-version-zero)
|
||||
* [JSON output object](#json-output-object)
|
||||
* [Overwrite labels](#overwrite-labels)
|
||||
* [Overwrite labels and annotations](#overwrite-labels-and-annotations)
|
||||
* [Annotations](#annotations)
|
||||
* [Contributing](#contributing)
|
||||
|
||||
## Usage
|
||||
@@ -74,23 +77,23 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@@ -128,11 +131,11 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
name/app
|
||||
@@ -144,13 +147,13 @@ jobs:
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@@ -204,13 +207,10 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
name/app
|
||||
@@ -222,16 +222,16 @@ jobs:
|
||||
type=sha
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
cwd://${{ steps.meta.outputs.bake-file }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with
|
||||
`refs/tags/v1.2.3` ref:
|
||||
Content of `${{ steps.meta.outputs.bake-file }}` file, combining tags and
|
||||
labels, will look like this with `refs/tags/v1.2.3` ref:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -262,12 +262,29 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with
|
||||
}
|
||||
```
|
||||
|
||||
You can also use the `bake-file-tags` and `bake-file-labels` outputs if you
|
||||
just want to use tags and/or labels respectively. The following example is
|
||||
similar to the previous one:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-labels }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
||||
### inputs
|
||||
|
||||
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
|
||||
> ```yaml
|
||||
> labels: |
|
||||
@@ -276,41 +293,50 @@ Following inputs can be used as `step.with` keys
|
||||
> org.opencontainers.image.vendor=MyCompany
|
||||
> ```
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------------|--------|-------------------------------------------------------------------------------|
|
||||
| `context` | String | Where to get context data. Allowed options are: `workflow` (default), `git`. |
|
||||
| `images` | List | List of Docker images to use as base name for tags |
|
||||
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||
| `labels` | List | List of custom labels |
|
||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
||||
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||
| Name | Type | Description |
|
||||
|-------------------|--------|------------------------------------------------------------------------------|
|
||||
| `context` | String | Where to get context data. Allowed options are: `workflow` (default), `git`. |
|
||||
| `images` | List | List of Docker images to use as base name for tags |
|
||||
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||
| `labels` | List | List of custom labels |
|
||||
| `annotations` | List | List of custom annotations |
|
||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
||||
| `sep-annotations` | String | Separator to use for annotations output (default `\n`) |
|
||||
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||
|
||||
### outputs
|
||||
|
||||
Following outputs are available
|
||||
The following outputs are available:
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|---------|--------------------------------------------------------------------------------------------|
|
||||
| `version` | String | Docker image version |
|
||||
| `tags` | String | Docker tags |
|
||||
| `labels` | String | Docker labels |
|
||||
| `json` | String | JSON output of tags and labels |
|
||||
| `bake-file` | File | [Bake file definition](https://docs.docker.com/build/customize/bake/file-definition/) path |
|
||||
| Name | Type | Description |
|
||||
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `version` | String | Docker image version |
|
||||
| `tags` | String | Docker tags |
|
||||
| `tag-names` | String | Docker tag names without image base name |
|
||||
| `labels` | String | Docker labels |
|
||||
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||
| `json` | String | JSON output of tags and labels |
|
||||
| `bake-file-tags` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with tags |
|
||||
| `bake-file-labels` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with labels |
|
||||
| `bake-file-annotations` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with [annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||
|
||||
Alternatively, each output is also exported as an environment variable:
|
||||
Alternatively, each output is also exported as an environment variable when `DOCKER_METADATA_SET_OUTPUT_ENV` is `true`:
|
||||
|
||||
* `DOCKER_METADATA_OUTPUT_VERSION`
|
||||
* `DOCKER_METADATA_OUTPUT_TAGS`
|
||||
* `DOCKER_METADATA_OUTPUT_LABELS`
|
||||
* `DOCKER_METADATA_OUTPUT_ANNOTATIONS`
|
||||
* `DOCKER_METADATA_OUTPUT_JSON`
|
||||
* `DOCKER_METADATA_OUTPUT_BAKE_FILE`
|
||||
* `DOCKER_METADATA_OUTPUT_BAKE_FILE_TAGS`
|
||||
* `DOCKER_METADATA_OUTPUT_BAKE_FILE_LABELS`
|
||||
* `DOCKER_METADATA_OUTPUT_BAKE_FILE_ANNOTATIONS`
|
||||
|
||||
So it can be used with our [Docker Build Push action](https://github.com/docker/build-push-action/):
|
||||
|
||||
```yaml
|
||||
- uses: docker/build-push-action@v4
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
build-args: |
|
||||
DOCKER_METADATA_OUTPUT_JSON
|
||||
@@ -318,9 +344,12 @@ So it can be used with our [Docker Build Push action](https://github.com/docker/
|
||||
|
||||
### environment variables
|
||||
|
||||
| Name | Type | Description |
|
||||
|-------------------------------|------|------------------------------------------------------------------------------------------------------------|
|
||||
| `DOCKER_METADATA_PR_HEAD_SHA` | Bool | If `true`, set associated head SHA instead of commit SHA that triggered the workflow on pull request event |
|
||||
| Name | Type | Description |
|
||||
|--------------------------------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `DOCKER_METADATA_PR_HEAD_SHA` | Bool | If `true`, set associated head SHA instead of commit SHA that triggered the workflow on pull request event |
|
||||
| `DOCKER_METADATA_SHORT_SHA_LENGTH` | Number | Specifies the length of the [short commit SHA](#typesha) to ensure uniqueness. Default is `7`, but can be increased for larger repositories. |
|
||||
| `DOCKER_METADATA_ANNOTATIONS_LEVELS` | String | Comma separated list of annotations levels to set for annotations output separated (default `manifest`) |
|
||||
| `DOCKER_METADATA_SET_OUTPUT_ENV` | Bool | If `true`, sets each output as an environment variable (default `true`) |
|
||||
|
||||
## `context` input
|
||||
|
||||
@@ -359,6 +388,8 @@ images: |
|
||||
* `name=<string>` image base name
|
||||
* `enable=<true|false>` enable this entry (default `true`)
|
||||
|
||||
If `images` is empty, tags will be generated without base name.
|
||||
|
||||
## `flavor` input
|
||||
|
||||
`flavor` defines a global behavior for [`tags`](#tags-input):
|
||||
@@ -433,7 +464,7 @@ tags: |
|
||||
# handlebars
|
||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||
# 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).
|
||||
@@ -465,6 +496,8 @@ tags: |
|
||||
type=semver,pattern={{version}}
|
||||
# use custom value instead of git tag
|
||||
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)
|
||||
@@ -480,18 +513,21 @@ with the following expressions:
|
||||
* `minor` ; minor version identifier
|
||||
* `patch` ; patch version identifier
|
||||
|
||||
| Git tag | Pattern | Output |
|
||||
|--------------------|----------------------------------------------------------|----------------------|
|
||||
| `v1.2.3` | `{{raw}}` | `v1.2.3` |
|
||||
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
||||
| `v1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
||||
| `v1.2.3` | `v{{major}}` | `v1` |
|
||||
| `v1.2.3` | `{{minor}}` | `2` |
|
||||
| `v1.2.3` | `{{patch}}` | `3` |
|
||||
| `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` | `{{major}}.{{minor}}` | `2.0.8-beta.67`* |
|
||||
| Git tag | Pattern | Match | Output |
|
||||
|------------------|-----------------------|----------------|------------------|
|
||||
| `v1.2.3` | `{{raw}}` | | `v1.2.3` |
|
||||
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
||||
| `v1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
||||
| `v1.2.3` | `v{{major}}` | | `v1` |
|
||||
| `v1.2.3` | `{{minor}}` | | `2` |
|
||||
| `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` | `{{version}}` | | `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}}`
|
||||
> 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
|
||||
@@ -501,7 +537,7 @@ Extended attributes and default values:
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=
|
||||
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=,match=
|
||||
```
|
||||
|
||||
### `type=pep440`
|
||||
@@ -512,6 +548,8 @@ tags: |
|
||||
type=pep440,pattern={{version}}
|
||||
# use custom value instead of git tag
|
||||
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)
|
||||
@@ -527,20 +565,22 @@ with the following expressions:
|
||||
* `minor` ; minor version identifier
|
||||
* `patch` ; patch version identifier
|
||||
|
||||
| Git tag | Pattern | Output |
|
||||
|--------------------|----------------------------------------------------------|----------------------|
|
||||
| `1.2.3` | `{{raw}}` | `1.2.3` |
|
||||
| `1.2.3` | `{{version}}` | `1.2.3` |
|
||||
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
||||
| `1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
||||
| `1.2.3` | `v{{major}}` | `v1` |
|
||||
| `v1.2.3rc2` | `{{raw}}` | `v1.2.3rc2` |
|
||||
| `1.2.3rc2` | `{{version}}` | `1.2.3rc2` |
|
||||
| `1.2.3rc2` | `{{major}}.{{minor}}` | `1.2.3rc2`* |
|
||||
| `1.2.3post1` | `{{major}}.{{minor}}` | `1.2.3.post1`* |
|
||||
| `1.2.3beta2` | `{{major}}.{{minor}}` | `1.2.3b2`* |
|
||||
| `1.0dev4` | `{{major}}.{{minor}}` | `1.0.dev4`* |
|
||||
| Git tag | Pattern | Match | Output |
|
||||
|--------------|-----------------------|----------------|----------------|
|
||||
| `1.2.3` | `{{raw}}` | | `1.2.3` |
|
||||
| `1.2.3` | `{{version}}` | | `1.2.3` |
|
||||
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
||||
| `1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
||||
| `1.2.3` | `v{{major}}` | | `v1` |
|
||||
| `v1.2.3rc2` | `{{raw}}` | | `v1.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.3post1` | `{{major}}.{{minor}}` | | `1.2.3.post1`* |
|
||||
| `1.2.3beta2` | `{{major}}.{{minor}}` | | `1.2.3b2`* |
|
||||
| `1.0dev4` | `{{major}}.{{minor}}` | | `1.0.dev4`* |
|
||||
|
||||
> [!IMPORTANT]
|
||||
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` 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
|
||||
@@ -677,7 +717,26 @@ tags: |
|
||||
type=sha,format=long
|
||||
```
|
||||
|
||||
Output Git short commit (or long if specified) as Docker tag like `sha-ad132f5`.
|
||||
Output Git short commit (or long if specified) as Docker tag like
|
||||
`sha-860c190`.
|
||||
|
||||
By default, the length of the short commit SHA is `7` characters. You can
|
||||
increase this length for larger repositories by setting the
|
||||
[`DOCKER_METADATA_SHORT_SHA_LENGTH` environment variable](#environment-variables):
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
name/app
|
||||
tags: |
|
||||
type=sha
|
||||
env:
|
||||
DOCKER_METADATA_SHORT_SHA_LENGTH: 12
|
||||
```
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@@ -711,6 +770,7 @@ generated by default (`auto` mode) for:
|
||||
|
||||
* [`type=ref,event=tag`](#typeref)
|
||||
* [`type=semver,pattern=...`](#typesemver)
|
||||
* [`type=pep440,pattern=...`](#typepep440)
|
||||
* [`type=match,pattern=...`](#typematch)
|
||||
|
||||
For conditionally tagging with latest for a specific branch name, e.g. if your
|
||||
@@ -752,7 +812,8 @@ Each tags `type` attribute has a default priority:
|
||||
### Global expressions
|
||||
|
||||
The following [Handlebars' template](https://handlebarsjs.com/guide/) expressions
|
||||
for `prefix`, `suffix`, `value` and `enable` attributes are available:
|
||||
for `prefix`, `suffix`, `value` and `enable` attributes of `tags` input are
|
||||
available:
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
@@ -762,6 +823,13 @@ tags: |
|
||||
type=raw,value=mytag-{{branch}}-{{sha}}
|
||||
```
|
||||
|
||||
They can also be applied to `labels` and `annotations` inputs:
|
||||
|
||||
```yaml
|
||||
labels: |
|
||||
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
||||
```
|
||||
|
||||
#### `{{branch}}`
|
||||
|
||||
Returns the branch name that triggered the workflow run. Will be empty if not
|
||||
@@ -802,6 +870,7 @@ workflow run. Will be empty for a branch reference:
|
||||
| `push` | `refs/heads/my/branch` | |
|
||||
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
||||
|
||||
> [!IMPORTANT]
|
||||
> *`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
|
||||
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
||||
@@ -813,6 +882,11 @@ workflow run. Will be empty for a branch reference:
|
||||
Returns `true` if the branch that triggered the workflow run is the default
|
||||
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>'}}`
|
||||
|
||||
Returns the current date rendered by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||
@@ -824,6 +898,20 @@ Default `tz` is UTC.
|
||||
| `{{date 'dddd, MMMM Do YYYY, h:mm:ss a'}}` | `Friday, January 10th 2020, 3:25:50 pm` |
|
||||
| `{{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||
|
||||
#### `{{commit_date '<format>' tz='<timezone>'}}`
|
||||
|
||||
Returns the date when the current git commit is committed, rendered by its
|
||||
[moment format](https://momentjs.com/docs/#/displaying/format/). It falls back
|
||||
to the current date if the commit date is not available.
|
||||
|
||||
Default `tz` is UTC.
|
||||
|
||||
| Expression | Output example |
|
||||
|-----------------------------------------------------|-----------------------------------------|
|
||||
| `{{commit_date 'YYYYMMDD'}}` | `20200110` |
|
||||
| `{{commit_date 'dddd, MMMM Do YYYY, h:mm:ss a'}}` | `Friday, January 10th 2020, 3:25:50 pm` |
|
||||
| `{{commit_date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||
|
||||
### Major version zero
|
||||
|
||||
Major version zero (`0.y.z`) is for initial development and **may** change at
|
||||
@@ -851,13 +939,13 @@ that you can reuse them further in your workflow using the [`fromJSON` function]
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -867,16 +955,17 @@ that you can reuse them further in your workflow using the [`fromJSON` function]
|
||||
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||
```
|
||||
|
||||
### Overwrite labels
|
||||
### Overwrite labels and annotations
|
||||
|
||||
If some [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
|
||||
labels generated are not suitable, you can overwrite them like this:
|
||||
generated are not suitable as labels/annotations, you can overwrite them like
|
||||
this:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
labels: |
|
||||
@@ -886,6 +975,78 @@ labels generated are not suitable, you can overwrite them like this:
|
||||
org.opencontainers.image.vendor=MyCompany
|
||||
```
|
||||
|
||||
### Annotations
|
||||
|
||||
Since Buildx 0.12, it is possible to set annotations to your image through the
|
||||
`--annotation` flag.
|
||||
|
||||
With the [`build-push-action`](https://github.com/docker/build-push-action/),
|
||||
you can set the `annotations` input with the value of the `annotations` output
|
||||
of the `metadata-action`:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
```
|
||||
|
||||
The same can be done with the [`bake-action`](https://github.com/docker/bake-action/):
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-annotations }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
Note that annotations can be attached at many different levels within a manifest.
|
||||
By default, the generated annotations will be attached to image manifests,
|
||||
but different registries may expect annotations at different places;
|
||||
a common practice is to read annotations at _image indexes_ if present,
|
||||
which are often used by multi-arch builds to index platform-specific images.
|
||||
If you want to specify level(s) for your annotations, you can use the
|
||||
[`DOCKER_METADATA_ANNOTATIONS_LEVELS` environment variable](#environment-variables)
|
||||
with a comma separated list of all levels the annotations should be attached to (defaults to `manifest`).
|
||||
The following configuration demonstrates the ability to attach annotations to both image manifests and image indexes,
|
||||
though your registry may only need annotations at the index level. (That is, `index` alone may be enough.)
|
||||
Please consult the documentation of your registry.
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
env:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
```
|
||||
|
||||
More information about annotations in the [BuildKit documentation](https://github.com/moby/buildkit/blob/master/docs/annotations.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to contribute? Awesome! You can find information about contributing to
|
||||
|
||||
-300
@@ -1,300 +0,0 @@
|
||||
# Upgrade notes
|
||||
|
||||
## v2 to v3
|
||||
|
||||
* Repository has been moved to docker org. Replace `crazy-max/ghaction-docker-meta@v2`
|
||||
with `docker/metadata-action@v4`
|
||||
* The default bake target has been changed: `ghaction-docker-meta` > `docker-metadata-action`
|
||||
|
||||
## v1 to v2
|
||||
|
||||
* [inputs](#inputs)
|
||||
* [`tag-sha`](#tag-sha)
|
||||
* [`tag-edge` / `tag-edge-branch`](#tag-edge--tag-edge-branch)
|
||||
* [`tag-semver`](#tag-semver)
|
||||
* [`tag-match` / `tag-match-group`](#tag-match--tag-match-group)
|
||||
* [`tag-latest`](#tag-latest)
|
||||
* [`tag-schedule`](#tag-schedule)
|
||||
* [`tag-custom` / `tag-custom-only`](#tag-custom--tag-custom-only)
|
||||
* [`label-custom`](#label-custom)
|
||||
* [Basic workflow](#basic-workflow)
|
||||
* [Semver workflow](#semver-workflow)
|
||||
|
||||
### inputs
|
||||
|
||||
| New | Unchanged | Removed |
|
||||
|------------|-----------------|--------------------|
|
||||
| `tags` | `images` | `tag-sha` |
|
||||
| `flavor` | `sep-tags` | `tag-edge` |
|
||||
| `labels` | `sep-labels` | `tag-edge-branch` |
|
||||
| | | `tag-semver` |
|
||||
| | | `tag-match` |
|
||||
| | | `tag-match-group` |
|
||||
| | | `tag-latest` |
|
||||
| | | `tag-schedule` |
|
||||
| | | `tag-custom` |
|
||||
| | | `tag-custom-only` |
|
||||
| | | `label-custom` |
|
||||
|
||||
#### `tag-sha`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=sha
|
||||
```
|
||||
|
||||
#### `tag-edge` / `tag-edge-branch`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
# default branch
|
||||
type=edge
|
||||
# specify branch
|
||||
type=edge,branch=main
|
||||
```
|
||||
|
||||
#### `tag-semver`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
```
|
||||
|
||||
#### `tag-match` / `tag-match-group`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=match,pattern=v(.*),group=1
|
||||
```
|
||||
|
||||
#### `tag-latest`
|
||||
|
||||
`tag-latest` is now handled through the [`flavor` input](README.md#flavor-input):
|
||||
|
||||
```yaml
|
||||
flavor: |
|
||||
latest=auto
|
||||
```
|
||||
|
||||
See also the notes about ["latest tag" behavior](README.md#latest-tag)
|
||||
|
||||
#### `tag-schedule`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
# default tag (nightly)
|
||||
type=schedule
|
||||
# specific pattern
|
||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||
```
|
||||
|
||||
#### `tag-custom` / `tag-custom-only`
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=raw,value=foo
|
||||
type=raw,value=bar
|
||||
# or
|
||||
type=raw,foo
|
||||
type=raw,bar
|
||||
# or
|
||||
foo
|
||||
bar
|
||||
```
|
||||
|
||||
#### `label-custom`
|
||||
|
||||
Same behavior for `labels`:
|
||||
|
||||
```yaml
|
||||
labels: |
|
||||
maintainer=CrazyMax
|
||||
```
|
||||
|
||||
### Basic workflow
|
||||
|
||||
```yaml
|
||||
# v1
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v1
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
```
|
||||
|
||||
```yaml
|
||||
# v2
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
```
|
||||
|
||||
### Semver workflow
|
||||
|
||||
```yaml
|
||||
# v1
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v1
|
||||
with:
|
||||
images: name/app
|
||||
tag-semver: |
|
||||
{{version}}
|
||||
{{major}}.{{minor}}
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
```
|
||||
|
||||
```yaml
|
||||
# v2
|
||||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: name/app
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
```
|
||||
@@ -1,207 +0,0 @@
|
||||
import {jest} from '@jest/globals';
|
||||
|
||||
export const context = {
|
||||
repo: {
|
||||
owner: 'docker',
|
||||
repo: 'actions-toolkit'
|
||||
},
|
||||
ref: 'refs/heads/master',
|
||||
runId: 123,
|
||||
payload: {
|
||||
after: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
base_ref: null,
|
||||
before: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
commits: [
|
||||
{
|
||||
author: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
committer: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
message: 'hello dev',
|
||||
timestamp: '2022-04-19T11:27:24+02:00',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
|
||||
}
|
||||
],
|
||||
compare: 'https://github.com/docker/test-docker-action/compare/5f3331d7f704...860c1904a1ce',
|
||||
created: false,
|
||||
deleted: false,
|
||||
forced: false,
|
||||
head_commit: {
|
||||
author: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
committer: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
message: 'hello dev',
|
||||
timestamp: '2022-04-19T11:27:24+02:00',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/860c1904a1ce19322e91ac35af1ab07466440c37'
|
||||
},
|
||||
organization: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
|
||||
description: 'Docker helps developers bring their ideas to life by conquering the complexity of app development.',
|
||||
events_url: 'https://api.github.com/orgs/docker/events',
|
||||
hooks_url: 'https://api.github.com/orgs/docker/hooks',
|
||||
id: 5429470,
|
||||
issues_url: 'https://api.github.com/orgs/docker/issues',
|
||||
login: 'docker',
|
||||
members_url: 'https://api.github.com/orgs/docker/members{/member}',
|
||||
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
|
||||
public_members_url: 'https://api.github.com/orgs/docker/public_members{/member}',
|
||||
repos_url: 'https://api.github.com/orgs/docker/repos',
|
||||
url: 'https://api.github.com/orgs/docker'
|
||||
},
|
||||
pusher: {
|
||||
email: 'github@crazymax.dev',
|
||||
name: 'crazy-max'
|
||||
},
|
||||
ref: 'refs/heads/dev',
|
||||
repository: {
|
||||
allow_forking: true,
|
||||
archive_url: 'https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}',
|
||||
archived: false,
|
||||
assignees_url: 'https://api.github.com/repos/docker/test-docker-action/assignees{/user}',
|
||||
blobs_url: 'https://api.github.com/repos/docker/test-docker-action/git/blobs{/sha}',
|
||||
branches_url: 'https://api.github.com/repos/docker/test-docker-action/branches{/branch}',
|
||||
clone_url: 'https://github.com/docker/test-docker-action.git',
|
||||
collaborators_url: 'https://api.github.com/repos/docker/test-docker-action/collaborators{/collaborator}',
|
||||
comments_url: 'https://api.github.com/repos/docker/test-docker-action/comments{/number}',
|
||||
commits_url: 'https://api.github.com/repos/docker/test-docker-action/commits{/sha}',
|
||||
compare_url: 'https://api.github.com/repos/docker/test-docker-action/compare/{base}...{head}',
|
||||
contents_url: 'https://api.github.com/repos/docker/test-docker-action/contents/{+path}',
|
||||
contributors_url: 'https://api.github.com/repos/docker/test-docker-action/contributors',
|
||||
created_at: 1596792180,
|
||||
default_branch: 'master',
|
||||
deployments_url: 'https://api.github.com/repos/docker/test-docker-action/deployments',
|
||||
description: 'Test "Docker" Actions',
|
||||
disabled: false,
|
||||
downloads_url: 'https://api.github.com/repos/docker/test-docker-action/downloads',
|
||||
events_url: 'https://api.github.com/repos/docker/test-docker-action/events',
|
||||
fork: false,
|
||||
forks: 1,
|
||||
forks_count: 1,
|
||||
forks_url: 'https://api.github.com/repos/docker/test-docker-action/forks',
|
||||
full_name: 'docker/test-docker-action',
|
||||
git_commits_url: 'https://api.github.com/repos/docker/test-docker-action/git/commits{/sha}',
|
||||
git_refs_url: 'https://api.github.com/repos/docker/test-docker-action/git/refs{/sha}',
|
||||
git_tags_url: 'https://api.github.com/repos/docker/test-docker-action/git/tags{/sha}',
|
||||
git_url: 'git://github.com/docker/test-docker-action.git',
|
||||
has_downloads: true,
|
||||
has_issues: true,
|
||||
has_pages: false,
|
||||
has_projects: true,
|
||||
has_wiki: true,
|
||||
homepage: '',
|
||||
hooks_url: 'https://api.github.com/repos/docker/test-docker-action/hooks',
|
||||
html_url: 'https://github.com/docker/test-docker-action',
|
||||
id: 285789493,
|
||||
is_template: false,
|
||||
issue_comment_url: 'https://api.github.com/repos/docker/test-docker-action/issues/comments{/number}',
|
||||
issue_events_url: 'https://api.github.com/repos/docker/test-docker-action/issues/events{/number}',
|
||||
issues_url: 'https://api.github.com/repos/docker/test-docker-action/issues{/number}',
|
||||
keys_url: 'https://api.github.com/repos/docker/test-docker-action/keys{/key_id}',
|
||||
labels_url: 'https://api.github.com/repos/docker/test-docker-action/labels{/name}',
|
||||
language: 'JavaScript',
|
||||
languages_url: 'https://api.github.com/repos/docker/test-docker-action/languages',
|
||||
license: {
|
||||
key: 'mit',
|
||||
name: 'MIT License',
|
||||
node_id: 'MDc6TGljZW5zZTEz',
|
||||
spdx_id: 'MIT',
|
||||
url: 'https://api.github.com/licenses/mit'
|
||||
},
|
||||
master_branch: 'master',
|
||||
merges_url: 'https://api.github.com/repos/docker/test-docker-action/merges',
|
||||
milestones_url: 'https://api.github.com/repos/docker/test-docker-action/milestones{/number}',
|
||||
mirror_url: null,
|
||||
name: 'test-docker-action',
|
||||
node_id: 'MDEwOlJlcG9zaXRvcnkyODU3ODk0OTM=',
|
||||
notifications_url: 'https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}',
|
||||
open_issues: 6,
|
||||
open_issues_count: 6,
|
||||
organization: 'docker',
|
||||
owner: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
|
||||
email: 'info@docker.com',
|
||||
events_url: 'https://api.github.com/users/docker/events{/privacy}',
|
||||
followers_url: 'https://api.github.com/users/docker/followers',
|
||||
following_url: 'https://api.github.com/users/docker/following{/other_user}',
|
||||
gists_url: 'https://api.github.com/users/docker/gists{/gist_id}',
|
||||
gravatar_id: '',
|
||||
html_url: 'https://github.com/docker',
|
||||
id: 5429470,
|
||||
login: 'docker',
|
||||
name: 'docker',
|
||||
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
|
||||
organizations_url: 'https://api.github.com/users/docker/orgs',
|
||||
received_events_url: 'https://api.github.com/users/docker/received_events',
|
||||
repos_url: 'https://api.github.com/users/docker/repos',
|
||||
site_admin: false,
|
||||
starred_url: 'https://api.github.com/users/docker/starred{/owner}{/repo}',
|
||||
subscriptions_url: 'https://api.github.com/users/docker/subscriptions',
|
||||
type: 'Organization',
|
||||
url: 'https://api.github.com/users/docker'
|
||||
},
|
||||
private: true,
|
||||
pulls_url: 'https://api.github.com/repos/docker/test-docker-action/pulls{/number}',
|
||||
pushed_at: 1650360446,
|
||||
releases_url: 'https://api.github.com/repos/docker/test-docker-action/releases{/id}',
|
||||
size: 796,
|
||||
ssh_url: 'git@github.com:docker/test-docker-action.git',
|
||||
stargazers: 0,
|
||||
stargazers_count: 0,
|
||||
stargazers_url: 'https://api.github.com/repos/docker/test-docker-action/stargazers',
|
||||
statuses_url: 'https://api.github.com/repos/docker/test-docker-action/statuses/{sha}',
|
||||
subscribers_url: 'https://api.github.com/repos/docker/test-docker-action/subscribers',
|
||||
subscription_url: 'https://api.github.com/repos/docker/test-docker-action/subscription',
|
||||
svn_url: 'https://github.com/docker/test-docker-action',
|
||||
tags_url: 'https://api.github.com/repos/docker/test-docker-action/tags',
|
||||
teams_url: 'https://api.github.com/repos/docker/test-docker-action/teams',
|
||||
topics: [],
|
||||
trees_url: 'https://api.github.com/repos/docker/test-docker-action/git/trees{/sha}',
|
||||
updated_at: '2022-04-19T09:05:09Z',
|
||||
url: 'https://github.com/docker/test-docker-action',
|
||||
visibility: 'private',
|
||||
watchers: 0,
|
||||
watchers_count: 0
|
||||
},
|
||||
sender: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/1951866?v=4',
|
||||
events_url: 'https://api.github.com/users/crazy-max/events{/privacy}',
|
||||
followers_url: 'https://api.github.com/users/crazy-max/followers',
|
||||
following_url: 'https://api.github.com/users/crazy-max/following{/other_user}',
|
||||
gists_url: 'https://api.github.com/users/crazy-max/gists{/gist_id}',
|
||||
gravatar_id: '',
|
||||
html_url: 'https://github.com/crazy-max',
|
||||
id: 1951866,
|
||||
login: 'crazy-max',
|
||||
node_id: 'MDQ6VXNlcjE5NTE4NjY=',
|
||||
organizations_url: 'https://api.github.com/users/crazy-max/orgs',
|
||||
received_events_url: 'https://api.github.com/users/crazy-max/received_events',
|
||||
repos_url: 'https://api.github.com/users/crazy-max/repos',
|
||||
site_admin: false,
|
||||
starred_url: 'https://api.github.com/users/crazy-max/starred{/owner}{/repo}',
|
||||
subscriptions_url: 'https://api.github.com/users/crazy-max/subscriptions',
|
||||
type: 'User',
|
||||
url: 'https://api.github.com/users/crazy-max'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const getOctokit = jest.fn();
|
||||
+101
-51
@@ -1,19 +1,10 @@
|
||||
import {afterEach, beforeEach, describe, expect, test, it, jest} from '@jest/globals';
|
||||
import * as dotenv from 'dotenv';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||
import {beforeEach, describe, expect, test, it, vi} from 'vitest';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
|
||||
import {ContextSource, getContext, getInputs, Inputs} from '../src/context';
|
||||
import * as context from '../src/context.js';
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
|
||||
return new Context();
|
||||
});
|
||||
});
|
||||
const toolkit = new Toolkit({githubToken: 'fake-github-token'});
|
||||
|
||||
describe('getInputs', () => {
|
||||
beforeEach(() => {
|
||||
@@ -26,23 +17,25 @@ describe('getInputs', () => {
|
||||
});
|
||||
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
const cases: [number, Map<string, string>, context.Inputs][] = [
|
||||
[
|
||||
0,
|
||||
new Map<string, string>([
|
||||
['images', 'moby/buildkit\nghcr.io/moby/mbuildkit'],
|
||||
]),
|
||||
{
|
||||
context: ContextSource.workflow,
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
||||
labels: [],
|
||||
annotations: [],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
sepAnnotations: '\n',
|
||||
tags: [],
|
||||
} as Inputs
|
||||
}
|
||||
],
|
||||
[
|
||||
1,
|
||||
@@ -51,18 +44,21 @@ describe('getInputs', () => {
|
||||
['images', 'moby/buildkit'],
|
||||
['sep-labels', ','],
|
||||
['sep-tags', ','],
|
||||
['sep-annotations', ',']
|
||||
]),
|
||||
{
|
||||
context: ContextSource.workflow,
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'metadata',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: ['moby/buildkit'],
|
||||
labels: [],
|
||||
annotations: [],
|
||||
sepLabels: ',',
|
||||
sepTags: ',',
|
||||
sepAnnotations: ',',
|
||||
tags: [],
|
||||
} as Inputs
|
||||
}
|
||||
],
|
||||
[
|
||||
2,
|
||||
@@ -70,57 +66,111 @@ describe('getInputs', () => {
|
||||
['images', 'moby/buildkit\n#comment\nghcr.io/moby/mbuildkit'],
|
||||
]),
|
||||
{
|
||||
context: ContextSource.workflow,
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
||||
labels: [],
|
||||
annotations: [],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
sepAnnotations: '\n',
|
||||
tags: [],
|
||||
} as Inputs
|
||||
}
|
||||
],
|
||||
])(
|
||||
'[%d] given %p as inputs, returns %p',
|
||||
async (num: number, inputs: Map<string, string>, expected: Inputs) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
expect(await getInputs()).toEqual(expected);
|
||||
}
|
||||
);
|
||||
[
|
||||
3,
|
||||
new Map<string, string>([
|
||||
['labels', 'mylabel=foo#bar\n#comment\nanother=bar'],
|
||||
]),
|
||||
{
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: [],
|
||||
labels: ['mylabel=foo#bar', 'another=bar'],
|
||||
annotations: [],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
sepAnnotations: '\n',
|
||||
tags: [],
|
||||
}
|
||||
],
|
||||
[
|
||||
4,
|
||||
new Map<string, string>([
|
||||
['annotations', 'org.opencontainers.image.url=https://example.com/path#readme\n#comment\norg.opencontainers.image.source=https://github.com/docker/metadata-action'],
|
||||
]),
|
||||
{
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: [],
|
||||
labels: [],
|
||||
annotations: [
|
||||
'org.opencontainers.image.url=https://example.com/path#readme',
|
||||
'org.opencontainers.image.source=https://github.com/docker/metadata-action'
|
||||
],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
sepAnnotations: '\n',
|
||||
tags: [],
|
||||
}
|
||||
],
|
||||
[
|
||||
5,
|
||||
new Map<string, string>([
|
||||
['tags', 'type=raw,value=foo#bar\n#comment'],
|
||||
['flavor', 'prefix=v#1\n#comment'],
|
||||
]),
|
||||
{
|
||||
context: context.ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: ['prefix=v#1'],
|
||||
githubToken: '',
|
||||
images: [],
|
||||
labels: [],
|
||||
annotations: [],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
sepAnnotations: '\n',
|
||||
tags: ['type=raw,value=foo#bar'],
|
||||
}
|
||||
],
|
||||
];
|
||||
test.each(cases)('[%d] given %o as inputs, returns %o', async (num: number, inputs: Map<string, string>, expected: context.Inputs) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
setInput(name, value);
|
||||
});
|
||||
const res = await context.getInputs();
|
||||
expect(res).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getContext', () => {
|
||||
const originalEnv = process.env;
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
...dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures/event_create_branch.env')))
|
||||
};
|
||||
});
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
});
|
||||
|
||||
it('workflow', async () => {
|
||||
const context = await getContext(ContextSource.workflow);
|
||||
expect(context.ref).toEqual('refs/heads/dev');
|
||||
expect(context.sha).toEqual('5f3331d7f7044c18ca9f12c77d961c4d7cf3276a');
|
||||
const ctx = await context.getContext(context.ContextSource.workflow, toolkit);
|
||||
expect(ctx.ref).toEqual('refs/heads/dev');
|
||||
expect(ctx.sha).toEqual('5f3331d7f7044c18ca9f12c77d961c4d7cf3276a');
|
||||
expect(ctx.commitDate).toEqual(new Date('2024-11-13T13:42:28.000Z'));
|
||||
});
|
||||
|
||||
it('git', async () => {
|
||||
jest.spyOn(Git, 'context').mockImplementation((): Promise<Context> => {
|
||||
vi.spyOn(Git, 'context').mockImplementation((): Promise<context.Context> => {
|
||||
return Promise.resolve({
|
||||
ref: 'refs/heads/git-test',
|
||||
sha: 'git-test-sha'
|
||||
} as Context);
|
||||
} as context.Context);
|
||||
});
|
||||
const context = await getContext(ContextSource.git);
|
||||
expect(context.ref).toEqual('refs/heads/git-test');
|
||||
expect(context.sha).toEqual('git-test-sha');
|
||||
vi.spyOn(Git, 'commitDate').mockImplementation(async (): Promise<Date> => {
|
||||
return new Date('2023-01-01T13:42:28.000Z');
|
||||
});
|
||||
const ctx = await context.getContext(context.ContextSource.git, toolkit);
|
||||
expect(ctx.ref).toEqual('refs/heads/git-test');
|
||||
expect(ctx.sha).toEqual('git-test-sha');
|
||||
expect(ctx.commitDate).toEqual(new Date('2023-01-01T13:42:28.000Z'));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
|
||||
import {Flavor, Transform} from '../src/flavor';
|
||||
import {Flavor, Transform} from '../src/flavor.js';
|
||||
|
||||
describe('transform', () => {
|
||||
// prettier-ignore
|
||||
@@ -175,7 +175,7 @@ describe('transform', () => {
|
||||
if (!invalid) {
|
||||
console.error(err);
|
||||
}
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
// eslint-disable-next-line vitest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
|
||||
import {Transform, Image} from '../src/image';
|
||||
import {Transform, Image} from '../src/image.js';
|
||||
|
||||
describe('transform', () => {
|
||||
// prettier-ignore
|
||||
@@ -95,7 +95,7 @@ describe('transform', () => {
|
||||
if (!invalid) {
|
||||
console.error(err);
|
||||
}
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
// eslint-disable-next-line vitest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
|
||||
+1246
-406
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,252 @@
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import {vi} from 'vitest';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-'));
|
||||
|
||||
const githubPayload = {
|
||||
after: '860c1904a1ce19322e91ac35af1ab07466440c37',
|
||||
base_ref: null,
|
||||
before: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
commits: [
|
||||
{
|
||||
author: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
committer: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
message: 'hello dev',
|
||||
timestamp: '2024-11-13T13:42:28Z',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/5f3331d7f7044c18ca9f12c77d961c4d7cf3276a'
|
||||
}
|
||||
],
|
||||
compare: 'https://github.com/docker/test-docker-action/compare/5f3331d7f704...860c1904a1ce',
|
||||
created: false,
|
||||
deleted: false,
|
||||
forced: false,
|
||||
head_commit: {
|
||||
author: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
committer: {
|
||||
email: 'crazy-max@users.noreply.github.com',
|
||||
name: 'CrazyMax',
|
||||
username: 'crazy-max'
|
||||
},
|
||||
distinct: true,
|
||||
id: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
message: 'hello dev',
|
||||
timestamp: '2024-11-13T13:42:28Z',
|
||||
tree_id: 'd2c60af597e863787d2d27f569e30495b0b92820',
|
||||
url: 'https://github.com/docker/test-docker-action/commit/5f3331d7f7044c18ca9f12c77d961c4d7cf3276a'
|
||||
},
|
||||
organization: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
|
||||
description: 'Docker helps developers bring their ideas to life by conquering the complexity of app development.',
|
||||
events_url: 'https://api.github.com/orgs/docker/events',
|
||||
hooks_url: 'https://api.github.com/orgs/docker/hooks',
|
||||
id: 5429470,
|
||||
issues_url: 'https://api.github.com/orgs/docker/issues',
|
||||
login: 'docker',
|
||||
members_url: 'https://api.github.com/orgs/docker/members{/member}',
|
||||
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
|
||||
public_members_url: 'https://api.github.com/orgs/docker/public_members{/member}',
|
||||
repos_url: 'https://api.github.com/orgs/docker/repos',
|
||||
url: 'https://api.github.com/orgs/docker'
|
||||
},
|
||||
pusher: {
|
||||
email: 'github@crazymax.dev',
|
||||
name: 'crazy-max'
|
||||
},
|
||||
ref: 'refs/heads/dev',
|
||||
repository: {
|
||||
allow_forking: true,
|
||||
archive_url: 'https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}',
|
||||
archived: false,
|
||||
assignees_url: 'https://api.github.com/repos/docker/test-docker-action/assignees{/user}',
|
||||
blobs_url: 'https://api.github.com/repos/docker/test-docker-action/git/blobs{/sha}',
|
||||
branches_url: 'https://api.github.com/repos/docker/test-docker-action/branches{/branch}',
|
||||
clone_url: 'https://github.com/docker/test-docker-action.git',
|
||||
collaborators_url: 'https://api.github.com/repos/docker/test-docker-action/collaborators{/collaborator}',
|
||||
comments_url: 'https://api.github.com/repos/docker/test-docker-action/comments{/number}',
|
||||
commits_url: 'https://api.github.com/repos/docker/test-docker-action/commits{/sha}',
|
||||
compare_url: 'https://api.github.com/repos/docker/test-docker-action/compare/{base}...{head}',
|
||||
contents_url: 'https://api.github.com/repos/docker/test-docker-action/contents/{+path}',
|
||||
contributors_url: 'https://api.github.com/repos/docker/test-docker-action/contributors',
|
||||
created_at: 1596792180,
|
||||
default_branch: 'master',
|
||||
deployments_url: 'https://api.github.com/repos/docker/test-docker-action/deployments',
|
||||
description: 'Test "Docker" Actions',
|
||||
disabled: false,
|
||||
downloads_url: 'https://api.github.com/repos/docker/test-docker-action/downloads',
|
||||
events_url: 'https://api.github.com/repos/docker/test-docker-action/events',
|
||||
fork: false,
|
||||
forks: 1,
|
||||
forks_count: 1,
|
||||
forks_url: 'https://api.github.com/repos/docker/test-docker-action/forks',
|
||||
full_name: 'docker/test-docker-action',
|
||||
git_commits_url: 'https://api.github.com/repos/docker/test-docker-action/git/commits{/sha}',
|
||||
git_refs_url: 'https://api.github.com/repos/docker/test-docker-action/git/refs{/sha}',
|
||||
git_tags_url: 'https://api.github.com/repos/docker/test-docker-action/git/tags{/sha}',
|
||||
git_url: 'git://github.com/docker/test-docker-action.git',
|
||||
has_downloads: true,
|
||||
has_issues: true,
|
||||
has_pages: false,
|
||||
has_projects: true,
|
||||
has_wiki: true,
|
||||
homepage: '',
|
||||
hooks_url: 'https://api.github.com/repos/docker/test-docker-action/hooks',
|
||||
html_url: 'https://github.com/docker/test-docker-action',
|
||||
id: 285789493,
|
||||
is_template: false,
|
||||
issue_comment_url: 'https://api.github.com/repos/docker/test-docker-action/issues/comments{/number}',
|
||||
issue_events_url: 'https://api.github.com/repos/docker/test-docker-action/issues/events{/number}',
|
||||
issues_url: 'https://api.github.com/repos/docker/test-docker-action/issues{/number}',
|
||||
keys_url: 'https://api.github.com/repos/docker/test-docker-action/keys{/key_id}',
|
||||
labels_url: 'https://api.github.com/repos/docker/test-docker-action/labels{/name}',
|
||||
language: 'JavaScript',
|
||||
languages_url: 'https://api.github.com/repos/docker/test-docker-action/languages',
|
||||
license: {
|
||||
key: 'mit',
|
||||
name: 'MIT License',
|
||||
node_id: 'MDc6TGljZW5zZTEz',
|
||||
spdx_id: 'MIT',
|
||||
url: 'https://api.github.com/licenses/mit'
|
||||
},
|
||||
master_branch: 'master',
|
||||
merges_url: 'https://api.github.com/repos/docker/test-docker-action/merges',
|
||||
milestones_url: 'https://api.github.com/repos/docker/test-docker-action/milestones{/number}',
|
||||
mirror_url: null,
|
||||
name: 'test-docker-action',
|
||||
node_id: 'MDEwOlJlcG9zaXRvcnkyODU3ODk0OTM=',
|
||||
notifications_url: 'https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}',
|
||||
open_issues: 6,
|
||||
open_issues_count: 6,
|
||||
organization: 'docker',
|
||||
owner: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/5429470?v=4',
|
||||
email: 'info@docker.com',
|
||||
events_url: 'https://api.github.com/users/docker/events{/privacy}',
|
||||
followers_url: 'https://api.github.com/users/docker/followers',
|
||||
following_url: 'https://api.github.com/users/docker/following{/other_user}',
|
||||
gists_url: 'https://api.github.com/users/docker/gists{/gist_id}',
|
||||
gravatar_id: '',
|
||||
html_url: 'https://github.com/docker',
|
||||
id: 5429470,
|
||||
login: 'docker',
|
||||
name: 'docker',
|
||||
node_id: 'MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=',
|
||||
organizations_url: 'https://api.github.com/users/docker/orgs',
|
||||
received_events_url: 'https://api.github.com/users/docker/received_events',
|
||||
repos_url: 'https://api.github.com/users/docker/repos',
|
||||
site_admin: false,
|
||||
starred_url: 'https://api.github.com/users/docker/starred{/owner}{/repo}',
|
||||
subscriptions_url: 'https://api.github.com/users/docker/subscriptions',
|
||||
type: 'Organization',
|
||||
url: 'https://api.github.com/users/docker'
|
||||
},
|
||||
private: true,
|
||||
pulls_url: 'https://api.github.com/repos/docker/test-docker-action/pulls{/number}',
|
||||
pushed_at: 1650360446,
|
||||
releases_url: 'https://api.github.com/repos/docker/test-docker-action/releases{/id}',
|
||||
size: 796,
|
||||
ssh_url: 'git@github.com:docker/test-docker-action.git',
|
||||
stargazers: 0,
|
||||
stargazers_count: 0,
|
||||
stargazers_url: 'https://api.github.com/repos/docker/test-docker-action/stargazers',
|
||||
statuses_url: 'https://api.github.com/repos/docker/test-docker-action/statuses/{sha}',
|
||||
subscribers_url: 'https://api.github.com/repos/docker/test-docker-action/subscribers',
|
||||
subscription_url: 'https://api.github.com/repos/docker/test-docker-action/subscription',
|
||||
svn_url: 'https://github.com/docker/test-docker-action',
|
||||
tags_url: 'https://api.github.com/repos/docker/test-docker-action/tags',
|
||||
teams_url: 'https://api.github.com/repos/docker/test-docker-action/teams',
|
||||
topics: [],
|
||||
trees_url: 'https://api.github.com/repos/docker/test-docker-action/git/trees{/sha}',
|
||||
updated_at: '2022-04-19T09:05:09Z',
|
||||
url: 'https://github.com/docker/test-docker-action',
|
||||
visibility: 'private',
|
||||
watchers: 0,
|
||||
watchers_count: 0
|
||||
},
|
||||
sender: {
|
||||
avatar_url: 'https://avatars.githubusercontent.com/u/1951866?v=4',
|
||||
events_url: 'https://api.github.com/users/crazy-max/events{/privacy}',
|
||||
followers_url: 'https://api.github.com/users/crazy-max/followers',
|
||||
following_url: 'https://api.github.com/users/crazy-max/following{/other_user}',
|
||||
gists_url: 'https://api.github.com/users/crazy-max/gists{/gist_id}',
|
||||
gravatar_id: '',
|
||||
html_url: 'https://github.com/crazy-max',
|
||||
id: 1951866,
|
||||
login: 'crazy-max',
|
||||
node_id: 'MDQ6VXNlcjE5NTE4NjY=',
|
||||
organizations_url: 'https://api.github.com/users/crazy-max/orgs',
|
||||
received_events_url: 'https://api.github.com/users/crazy-max/received_events',
|
||||
repos_url: 'https://api.github.com/users/crazy-max/repos',
|
||||
site_admin: false,
|
||||
starred_url: 'https://api.github.com/users/crazy-max/starred{/owner}{/repo}',
|
||||
subscriptions_url: 'https://api.github.com/users/crazy-max/subscriptions',
|
||||
type: 'User',
|
||||
url: 'https://api.github.com/users/crazy-max'
|
||||
}
|
||||
};
|
||||
|
||||
const githubEventPath = path.join(tmpDir, 'github-event.json');
|
||||
fs.writeFileSync(githubEventPath, JSON.stringify(githubPayload));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/metadata-action',
|
||||
GITHUB_REF: 'refs/heads/dev',
|
||||
GITHUB_RUN_ID: '2188748038',
|
||||
GITHUB_RUN_ATTEMPT: '1',
|
||||
GITHUB_RUN_NUMBER: '15',
|
||||
GITHUB_SHA: '5f3331d7f7044c18ca9f12c77d961c4d7cf3276a',
|
||||
GITHUB_EVENT_PATH: githubEventPath,
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
});
|
||||
|
||||
const getCommitMock = vi.hoisted(() =>
|
||||
vi.fn(async () => ({
|
||||
data: {
|
||||
commit: {
|
||||
committer: {
|
||||
date: '2024-11-13T13:42:28Z'
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
);
|
||||
|
||||
const getOctokitMock = vi.hoisted(() =>
|
||||
vi.fn(() => ({
|
||||
rest: {
|
||||
repos: {
|
||||
getCommit: getCommitMock
|
||||
}
|
||||
}
|
||||
}))
|
||||
);
|
||||
|
||||
vi.mock('@actions/github', async importOriginal => {
|
||||
const actual = await importOriginal<typeof import('@actions/github')>();
|
||||
return {
|
||||
...actual,
|
||||
context: {
|
||||
...actual.context,
|
||||
payload: githubPayload
|
||||
},
|
||||
getOctokit: getOctokitMock
|
||||
};
|
||||
});
|
||||
+26
-8
@@ -1,6 +1,6 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
import {describe, expect, test} from 'vitest';
|
||||
|
||||
import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag';
|
||||
import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag.js';
|
||||
|
||||
describe('transform', () => {
|
||||
// prettier-ignore
|
||||
@@ -32,7 +32,8 @@ describe('transform', () => {
|
||||
"priority": DefaultPriorities[Type.Semver],
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -106,7 +107,7 @@ describe('transform', () => {
|
||||
if (!invalid) {
|
||||
console.error(err);
|
||||
}
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
// eslint-disable-next-line vitest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
@@ -147,7 +148,8 @@ describe('parse', () => {
|
||||
"priority": DefaultPriorities[Type.Semver],
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@@ -160,7 +162,8 @@ describe('parse', () => {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@@ -173,7 +176,22 @@ describe('parse', () => {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"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,
|
||||
false
|
||||
@@ -443,7 +461,7 @@ describe('parse', () => {
|
||||
if (!invalid) {
|
||||
console.error(err);
|
||||
}
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
// eslint-disable-next-line vitest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
|
||||
+20
-4
@@ -13,7 +13,7 @@ inputs:
|
||||
required: true
|
||||
images:
|
||||
description: 'List of Docker images to use as base name for tags'
|
||||
required: true
|
||||
required: false
|
||||
tags:
|
||||
description: 'List of tags as key-value pair attributes'
|
||||
required: false
|
||||
@@ -23,12 +23,18 @@ inputs:
|
||||
labels:
|
||||
description: 'List of custom labels'
|
||||
required: false
|
||||
annotations:
|
||||
description: 'List of custom annotations'
|
||||
required: false
|
||||
sep-tags:
|
||||
description: 'Separator to use for tags output (default \n)'
|
||||
required: false
|
||||
sep-labels:
|
||||
description: 'Separator to use for labels output (default \n)'
|
||||
required: false
|
||||
sep-annotations:
|
||||
description: 'Separator to use for annotations output (default \n)'
|
||||
required: false
|
||||
bake-target:
|
||||
description: 'Bake target name (default docker-metadata-action)'
|
||||
required: false
|
||||
@@ -42,13 +48,23 @@ outputs:
|
||||
description: 'Generated Docker image version'
|
||||
tags:
|
||||
description: 'Generated Docker tags'
|
||||
tag-names:
|
||||
description: 'Generated Docker tag names without image base name'
|
||||
labels:
|
||||
description: 'Generated Docker labels'
|
||||
bake-file:
|
||||
description: 'Bake definiton file'
|
||||
annotations:
|
||||
description: 'Generated annotations'
|
||||
json:
|
||||
description: 'JSON output of tags and labels'
|
||||
bake-file-tags:
|
||||
description: 'Bake definition file with tags'
|
||||
bake-file-labels:
|
||||
description: 'Bake definition file with labels'
|
||||
bake-file-annotations:
|
||||
description: 'Bake definition file with annotations'
|
||||
bake-file:
|
||||
description: 'Bake definition file with tags and labels'
|
||||
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node24'
|
||||
main: 'dist/index.js'
|
||||
+30
-12
@@ -1,13 +1,21 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=16
|
||||
ARG NODE_VERSION=24
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
RUN apk add --no-cache cpio findutils git rsync
|
||||
WORKDIR /src
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||
set -e
|
||||
corepack enable
|
||||
yarn --version
|
||||
yarn config set --home enableTelemetry 0
|
||||
EOT
|
||||
|
||||
FROM base AS deps
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||
|
||||
@@ -20,24 +28,34 @@ RUN --mount=type=bind,target=.,rw <<EOT
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS build
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||
RUN --mount=target=/context \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules <<EOT
|
||||
set -e
|
||||
rsync -a /context/. .
|
||||
rm -rf dist
|
||||
yarn run build
|
||||
mkdir /out
|
||||
cp -r dist /out
|
||||
EOT
|
||||
|
||||
FROM scratch AS build-update
|
||||
COPY --from=build /out /
|
||||
|
||||
FROM build AS build-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
RUN --mount=target=/context \
|
||||
--mount=target=.,type=tmpfs <<EOT
|
||||
set -e
|
||||
rsync -a /context/. .
|
||||
git add -A
|
||||
rm -rf dist
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
@@ -48,24 +66,24 @@ EOT
|
||||
|
||||
FROM deps AS format
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run format \
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
||||
yarn run format && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||
|
||||
FROM scratch AS format-update
|
||||
COPY --from=format /out /
|
||||
|
||||
FROM deps AS lint
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM deps AS test
|
||||
ENV RUNNER_TEMP=/tmp/github_runner
|
||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run test --coverageDirectory=/tmp/coverage
|
||||
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
+299
@@ -0,0 +1,299 @@
|
||||
export const id = 606;
|
||||
export const ids = [606];
|
||||
export const 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
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"606.index.js","mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":[".././node_modules/p-map/index.js"],"sourcesContent":["export default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve_, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst signalListener = () => {\n\t\t\treject(signal.reason);\n\t\t};\n\n\t\tconst cleanup = () => {\n\t\t\tsignal?.removeEventListener('abort', signalListener);\n\t\t};\n\n\t\tconst resolve = value => {\n\t\t\tresolve_(value);\n\t\t\tcleanup();\n\t\t};\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t\tcleanup();\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(signal.reason);\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', signalListener, {once: true});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\Line truncated
|
||||
+54
-21
@@ -1,74 +1,107 @@
|
||||
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7351:function(p,r,a){"use strict";var i=this&&this.__createBinding||(Object.create?function(p,r,a,i){if(i===undefined)i=a;Object.defineProperty(p,i,{enumerable:true,get:function(){return r[a]}})}:function(p,r,a,i){if(i===undefined)i=a;p[i]=r[a]});var d=this&&this.__setModuleDefault||(Object.create?function(p,r){Object.defineProperty(p,"default",{enumerable:true,value:r})}:function(p,r){p["default"]=r});var c=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var r={};if(p!=null)for(var a in p)if(a!=="default"&&Object.hasOwnProperty.call(p,a))i(r,p,a);d(r,p);return r};Object.defineProperty(r,"__esModule",{value:true});r.issue=r.issueCommand=void 0;const b=c(a(2037));const M=a(5278);function issueCommand(p,r,a){const i=new Command(p,r,a);process.stdout.write(i.toString()+b.EOL)}r.issueCommand=issueCommand;function issue(p,r=""){issueCommand(p,{},r)}r.issue=issue;const z="::";class Command{constructor(p,r,a){if(!p){p="missing.command"}this.command=p;this.properties=r;this.message=a}toString(){let p=z+this.command;if(this.properties&&Object.keys(this.properties).length>0){p+=" ";let r=true;for(const a in this.properties){if(this.properties.hasOwnProperty(a)){const i=this.properties[a];if(i){if(r){r=false}else{p+=","}p+=`${a}=${escapeProperty(i)}`}}}}p+=`${z}${escapeData(this.message)}`;return p}}function escapeData(p){return M.toCommandValue(p).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escapeProperty(p){return M.toCommandValue(p).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}},2186:function(p,r,a){"use strict";var i=this&&this.__createBinding||(Object.create?function(p,r,a,i){if(i===undefined)i=a;Object.defineProperty(p,i,{enumerable:true,get:function(){return r[a]}})}:function(p,r,a,i){if(i===undefined)i=a;p[i]=r[a]});var d=this&&this.__setModuleDefault||(Object.create?function(p,r){Object.defineProperty(p,"default",{enumerable:true,value:r})}:function(p,r){p["default"]=r});var c=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var r={};if(p!=null)for(var a in p)if(a!=="default"&&Object.hasOwnProperty.call(p,a))i(r,p,a);d(r,p);return r};var b=this&&this.__awaiter||function(p,r,a,i){function adopt(p){return p instanceof a?p:new a((function(r){r(p)}))}return new(a||(a=Promise))((function(a,d){function fulfilled(p){try{step(i.next(p))}catch(p){d(p)}}function rejected(p){try{step(i["throw"](p))}catch(p){d(p)}}function step(p){p.done?a(p.value):adopt(p.value).then(fulfilled,rejected)}step((i=i.apply(p,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.getIDToken=r.getState=r.saveState=r.group=r.endGroup=r.startGroup=r.info=r.notice=r.warning=r.error=r.debug=r.isDebug=r.setFailed=r.setCommandEcho=r.setOutput=r.getBooleanInput=r.getMultilineInput=r.getInput=r.addPath=r.setSecret=r.exportVariable=r.ExitCode=void 0;const M=a(7351);const z=a(717);const u=a(5278);const O=c(a(2037));const l=c(a(1017));const A=a(8041);var m;(function(p){p[p["Success"]=0]="Success";p[p["Failure"]=1]="Failure"})(m=r.ExitCode||(r.ExitCode={}));function exportVariable(p,r){const a=u.toCommandValue(r);process.env[p]=a;const i=process.env["GITHUB_ENV"]||"";if(i){return z.issueFileCommand("ENV",z.prepareKeyValueMessage(p,r))}M.issueCommand("set-env",{name:p},a)}r.exportVariable=exportVariable;function setSecret(p){M.issueCommand("add-mask",{},p)}r.setSecret=setSecret;function addPath(p){const r=process.env["GITHUB_PATH"]||"";if(r){z.issueFileCommand("PATH",p)}else{M.issueCommand("add-path",{},p)}process.env["PATH"]=`${p}${l.delimiter}${process.env["PATH"]}`}r.addPath=addPath;function getInput(p,r){const a=process.env[`INPUT_${p.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!a){throw new Error(`Input required and not supplied: ${p}`)}if(r&&r.trimWhitespace===false){return a}return a.trim()}r.getInput=getInput;function getMultilineInput(p,r){const a=getInput(p,r).split("\n").filter((p=>p!==""));if(r&&r.trimWhitespace===false){return a}return a.map((p=>p.trim()))}r.getMultilineInput=getMultilineInput;function getBooleanInput(p,r){const a=["true","True","TRUE"];const i=["false","False","FALSE"];const d=getInput(p,r);if(a.includes(d))return true;if(i.includes(d))return false;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${p}\n`+`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}r.getBooleanInput=getBooleanInput;function setOutput(p,r){const a=process.env["GITHUB_OUTPUT"]||"";if(a){return z.issueFileCommand("OUTPUT",z.prepareKeyValueMessage(p,r))}process.stdout.write(O.EOL);M.issueCommand("set-output",{name:p},u.toCommandValue(r))}r.setOutput=setOutput;function setCommandEcho(p){M.issue("echo",p?"on":"off")}r.setCommandEcho=setCommandEcho;function setFailed(p){process.exitCode=m.Failure;error(p)}r.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}r.isDeLine truncated
|
||||
/*!
|
||||
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
||||
import './sourcemap-register.cjs';import{createRequire as t}from"module";var r={23311:function(t,r){var o=this&&this.__awaiter||function(t,r,o,i){function adopt(t){return t instanceof o?t:new o((function(r){r(t)}))}return new(o||(o=Promise))((function(o,a){function fulfilled(t){try{step(i.next(t))}catch(t){a(t)}}function rejected(t){try{step(i["throw"](t))}catch(t){a(t)}}function step(t){t.done?o(t.value):adopt(t.value).then(fulfilled,rejected)}step((i=i.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(t,r,o,i,a,c,p){this.method=t;this.requestHeaders=r;this.requests=o;this.headers=i;this.response=a;this.status=c;this.trailers=p}then(t,r){return this.promiseFinished().then((r=>t?Promise.resolve(t(r)):r),(t=>r?Promise.resolve(r(t)):Promise.reject(t)))}promiseFinished(){return o(this,void 0,void 0,(function*(){let[t,r,o,i]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:t,response:r,status:o,trailers:i}}))}}r.ClientStreamingCall=ClientStreamingCall},69499:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.Deferred=r.DeferredState=void 0;var o;(function(t){t[t["PENDING"]=0]="PENDING";t[t["REJECTED"]=1]="REJECTED";t[t["RESOLVED"]=2]="RESOLVED"})(o=r.DeferredState||(r.DeferredState={}));class Deferred{constructor(t=true){this._state=o.PENDING;this._promise=new Promise(((t,r)=>{this._resolve=t;this._reject=r}));if(t){this._promise.catch((t=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(t){if(this.state!==o.PENDING)throw new Error(`cannot resolve ${o[this.state].toLowerCase()}`);this._resolve(t);this._state=o.RESOLVED}reject(t){if(this.state!==o.PENDING)throw new Error(`cannot reject ${o[this.state].toLowerCase()}`);this._reject(t);this._state=o.REJECTED}resolvePending(t){if(this._state===o.PENDING)this.resolve(t)}rejectPending(t){if(this._state===o.PENDING)this.reject(t)}}r.Deferred=Deferred},40800:function(t,r){var o=this&&this.__awaiter||function(t,r,o,i){function adopt(t){return t instanceof o?t:new o((function(r){r(t)}))}return new(o||(o=Promise))((function(o,a){function fulfilled(t){try{step(i.next(t))}catch(t){a(t)}}function rejected(t){try{step(i["throw"](t))}catch(t){a(t)}}function step(t){t.done?o(t.value):adopt(t.value).then(fulfilled,rejected)}step((i=i.apply(t,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:true});r.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(t,r,o,i,a,c,p){this.method=t;this.requestHeaders=r;this.requests=o;this.headers=i;this.responses=a;this.status=c;this.trailers=p}then(t,r){return this.promiseFinished().then((r=>t?Promise.resolve(t(r)):r),(t=>r?Promise.resolve(r(t)):Promise.reject(t)))}promiseFinished(){return o(this,void 0,void 0,(function*(){let[t,r,o]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:t,status:r,trailers:o}}))}}r.DuplexStreamingCall=DuplexStreamingCall},76762:(t,r,o)=>{var i;i={value:true};var a=o(42554);Object.defineProperty(r,"C0",{enumerable:true,get:function(){return a.ServiceType}});var c=o(83402);i={enumerable:true,get:function(){return c.readMethodOptions}};i={enumerable:true,get:function(){return c.readMethodOption}};i={enumerable:true,get:function(){return c.readServiceOption}};var p=o(50422);i={enumerable:true,get:function(){return p.RpcError}};var u=o(63474);i={enumerable:true,get:function(){return u.mergeRpcOptions}};var l=o(58788);i={enumerable:true,get:function(){return l.RpcOutputStreamController}};var d=o(37816);i={enumerable:true,get:function(){return d.TestTransport}};var A=o(69499);i={enumerable:true,get:function(){return A.Deferred}};i={enumerable:true,get:function(){return A.DeferredState}};var b=o(40800);i={enumerable:true,get:function(){return b.DuplexStreamingCall}};var h=o(23311);i={enumerable:true,get:function(){return h.ClientStreamingCall}};var M=o(22715);i={enumerable:true,get:function(){return M.ServerStreamingCall}};var g=o(80738);i={enumerable:true,get:function(){return g.UnaryCall}};var z=o(84359);i={enumerable:true,get:function(){return z.stackIntercept}};i={enumerable:true,get:function(){return z.stackDuplexStreamingInterceptors}};i={enumerable:true,get:function(){return z.stackClientStreamingInterceptors}};i={enumerable:true,get:function(){return z.stackServerStreamingInterceptors}};i={enumerable:true,get:function(){return z.stackUnaryInterceptors}};var O=o(44626);i={enumerable:true,get:function(){return O.ServerCallContextController}}},83402:(t,r,o)=>{Object.defineProperty(r,"__esModule",{value:true});r.readServiceOption=r.readMethodOption=r.readMethodOptions=r.normalizeMethodInfo=void 0;const i=o(88372);function normalizeMethodInfo(t,r){var o,a,c;let p=t;p.service=r;p.localName=(o=p.localName)!==null&&o!==void 0?o:i.lowerCamelCase(p.name);p.serverStreaming=!!p.serverStreaming;p.Line truncated
|
||||
/**
|
||||
* @preserve
|
||||
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/function isObject(p){return Object.prototype.toString.call(p)==="[object Object]"}function isPlainObject(p){var r,a;if(isObject(p)===false)return false;r=p.constructor;if(r===undefined)return true;a=r.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}r.isPlainObject=isPlainObject},4329:p=>{"use strict";function e(p){this.message=p}e.prototype=new Error,e.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(p){var r=String(p).replace(/=+$/,"");if(r.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var a,i,d=0,c=0,b="";i=r.charAt(c++);~i&&(a=d%4?64*a+i:i,d++%4)?b+=String.fromCharCode(255&a>>(-2*d&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return b};function t(p){var a=p.replace(/-/g,"+").replace(/_/g,"/");switch(a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw"Illegal base64url string!"}try{return function(p){return decodeURIComponent(r(p).replace(/(.)/g,(function(p,r){var a=r.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a})))}(a)}catch(p){return r(a)}}function n(p){this.message=p}function o(p,r){if("string"!=typeof p)throw new n("Invalid token specified");var a=!0===(r=r||{}).header?0:1;try{return JSON.parse(t(p.split(".")[a]))}catch(p){throw new n("Invalid token specified: "+p.message)}}n.prototype=new Error,n.prototype.name="InvalidTokenError";const a=o;a.default=o,a.InvalidTokenError=n,p.exports=a},7129:(p,r,a)=>{"use strict";const i=a(665);const d=Symbol("max");const c=Symbol("length");const b=Symbol("lengthCalculator");const M=Symbol("allowStale");const z=Symbol("maxAge");const u=Symbol("dispose");const O=Symbol("noDisposeOnSet");const l=Symbol("lruList");const A=Symbol("cache");const m=Symbol("updateAgeOnGet");const naiveLength=()=>1;class LRUCache{constructor(p){if(typeof p==="number")p={max:p};if(!p)p={};if(p.max&&(typeof p.max!=="number"||p.max<0))throw new TypeError("max must be a non-negative number");const r=this[d]=p.max||Infinity;const a=p.length||naiveLength;this[b]=typeof a!=="function"?naiveLength:a;this[M]=p.stale||false;if(p.maxAge&&typeof p.maxAge!=="number")throw new TypeError("maxAge must be a number");this[z]=p.maxAge||0;this[u]=p.dispose;this[O]=p.noDisposeOnSet||false;this[m]=p.updateAgeOnGet||false;this.reset()}set max(p){if(typeof p!=="number"||p<0)throw new TypeError("max must be a non-negative number");this[d]=p||Infinity;trim(this)}get max(){return this[d]}set allowStale(p){this[M]=!!p}get allowStale(){return this[M]}set maxAge(p){if(typeof p!=="number")throw new TypeError("maxAge must be a non-negative number");this[z]=p;trim(this)}get maxAge(){return this[z]}set lengthCalculator(p){if(typeof p!=="function")p=naiveLength;if(p!==this[b]){this[b]=p;this[c]=0;this[l].forEach((p=>{p.length=this[b](p.value,p.key);this[c]+=p.length}))}trim(this)}get lengthCalculator(){return this[b]}get length(){return this[c]}get itemCount(){return this[l].length}rforEach(p,r){r=r||this;for(let a=this[l].tail;a!==null;){const i=a.prev;forEachStep(this,p,a,r);a=i}}forEach(p,r){r=r||this;for(let a=this[l].head;a!==null;){const i=a.next;forEachStep(this,p,a,r);a=i}}keys(){return this[l].toArray().map((p=>p.key))}values(){return this[l].toArray().map((p=>p.value))}reset(){if(this[u]&&this[l]&&this[l].length){this[l].forEach((p=>this[u](p.key,p.value)))}this[A]=new Map;this[l]=new i;this[c]=0}dump(){return this[l].map((p=>isStale(this,p)?false:{k:p.key,v:p.value,e:p.now+(p.maxAge||0)})).toArray().filter((p=>p))}dumpLru(){return this[l]}set(p,r,a){a=a||this[z];if(a&&typeof a!=="number")throw new TypeError("maxAge must be a number");const i=a?Date.now():0;const M=this[b](r,p);if(this[A].has(p)){if(M>this[d]){del(this,this[A].get(p));return false}const b=this[A].get(p);const z=b.value;if(this[u]){if(!this[O])this[u](p,z.value)}z.now=i;z.maxAge=a;z.value=r;this[c]+=M-z.length;z.length=M;this.get(p);trim(this);return true}const m=new Entry(p,r,M,i,a);if(m.length>this[d]){if(this[u])this[u](p,r);return false}this[c]+=m.length;this[l].unshift(m);this[A].set(p,this[l].head);trim(this);return true}has(p){if(!this[A].has(p))return false;const r=this[A].get(p).value;return!isStale(this,r)}get(p){return get(this,p,true)}peek(p){return get(this,p,false)}pop(){const p=this[l].tail;if(!p)return null;del(this,p);return p.value}del(p){del(this,this[A].get(p))}load(p){this.reset();const r=Date.now();for(let a=p.length-1;a>=0;a--){const i=p[a];const d=i.e||0;if(d===0)this.set(i.k,i.v);else{const p=d-r;if(p>0){this.set(i.k,i.v,p)}}}}prune(){this[A].forEach(((p,r)=>get(this,r,false)))}}const get=(p,r,a)=>{const i=p[A].get(r);if(i){const r=i.value;if(isStale(p,r)){del(p,i);if(!p[M])return undefined}else{if(a){if(p[m])i.value.now=Date.now();p[l].unshiftNode(i)}}return r.value}};const isStale=(p,r)=>{if(!r||!r.maxAge&&!p[z])return false;const
Line truncated
|
||||
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
||||
* @see http://github.com/homebrewing/brauhaus-diff
|
||||
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
||||
* @see http://github.com/garycourt/murmurhash-js
|
||||
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
||||
* @see http://sites.google.com/site/murmurhash/
|
||||
*/
|
||||
(function(){var r;function MurmurHash3(t,o){var i=this instanceof MurmurHash3?this:r;i.reset(o);if(typeof t==="string"&&t.length>0){i.hash(t)}if(i!==this){return i}}MurmurHash3.prototype.hash=function(t){var r,o,i,a,c;c=t.length;this.len+=c;o=this.k1;i=0;switch(this.rem){case 0:o^=c>i?t.charCodeAt(i++)&65535:0;case 1:o^=c>i?(t.charCodeAt(i++)&65535)<<8:0;case 2:o^=c>i?(t.charCodeAt(i++)&65535)<<16:0;case 3:o^=c>i?(t.charCodeAt(i)&255)<<24:0;o^=c>i?(t.charCodeAt(i++)&65280)>>8:0}this.rem=c+this.rem&3;c-=this.rem;if(c>0){r=this.h1;while(1){o=o*11601+(o&65535)*3432906752&4294967295;o=o<<15|o>>>17;o=o*13715+(o&65535)*461832192&4294967295;r^=o;r=r<<13|r>>>19;r=r*5+3864292196&4294967295;if(i>=c){break}o=t.charCodeAt(i++)&65535^(t.charCodeAt(i++)&65535)<<8^(t.charCodeAt(i++)&65535)<<16;a=t.charCodeAt(i++);o^=(a&255)<<24^(a&65280)>>8}o=0;switch(this.rem){case 3:o^=(t.charCodeAt(i+2)&65535)<<16;case 2:o^=(t.charCodeAt(i+1)&65535)<<8;case 1:o^=t.charCodeAt(i)&65535}this.h1=r}this.k1=o;return this};MurmurHash3.prototype.result=function(){var t,r;t=this.k1;r=this.h1;if(t>0){t=t*11601+(t&65535)*3432906752&4294967295;t=t<<15|t>>>17;t=t*13715+(t&65535)*461832192&4294967295;r^=t}r^=this.len;r^=r>>>16;r=r*51819+(r&65535)*2246770688&4294967295;r^=r>>>13;r=r*44597+(r&65535)*3266445312&4294967295;r^=r>>>16;return r>>>0};MurmurHash3.prototype.reset=function(t){this.h1=typeof t==="number"?t:0;this.rem=this.k1=this.len=0;return this};r=new MurmurHash3;if(true){t.exports=MurmurHash3}else{}})()},68850:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.AddressError=void 0;class AddressError extends Error{constructor(t,r){super(t);this.name="AddressError";if(r!==null){this.parseMessage=r}}}r.AddressError=AddressError},45864:(t,r)=>{Object.defineProperty(r,"__esModule",{value:true});r.isCorrect=r.isInSubnet=void 0;function isInSubnet(t){if(this.subnetMask<t.subnetMask){return false}if(this.mask(t.subnetMask)===t.mask()){return true}return false}r.isInSubnet=isInSubnet;function isCorrect(t){return function(){if(this.addressMinusSuffix!==this.correctForm()){return false}if(this.subnetMask===t&&!this.parsedSubnet){return true}return this.parsedSubnet===String(this.subnetMask)}}r.isCorrect=isCorrect},79253:function(t,r,o){var i=this&&this.__createBinding||(Object.create?function(t,r,o,i){if(i===undefined)i=o;var a=Object.getOwnPropertyDescriptor(r,o);if(!a||("get"in a?!r.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return r[o]}}}Object.defineProperty(t,i,a)}:function(t,r,o,i){if(i===undefined)i=o;t[i]=r[o]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o))i(r,t,o);a(r,t);return r};Object.defineProperty(r,"__esModule",{value:true});r.v6=r.AddressError=r.Address6=r.Address4=void 0;const p=o(17946);Object.defineProperty(r,"Address4",{enumerable:true,get:function(){return p.Address4}});const u=o(38096);Object.defineProperty(r,"Address6",{enumerable:true,get:function(){return u.Address6}});const l=o(68850);Object.defineProperty(r,"AddressError",{enumerable:true,get:function(){return l.AddressError}});const d=c(o(20339));r.v6={helpers:d}},17946:function(t,r,o){var i=this&&this.__createBinding||(Object.create?function(t,r,o,i){if(i===undefined)i=o;var a=Object.getOwnPropertyDescriptor(r,o);if(!a||("get"in a?!r.__esModule:a.writable||a.configurable)){a={enumerable:true,get:function(){return r[o]}}}Object.defineProperty(t,i,a)}:function(t,r,o,i){if(i===undefined)i=o;t[i]=r[o]});var a=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:true,value:r})}:function(t,r){t["default"]=r});var c=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var o in t)if(o!=="default"&&Object.prototype.hasOwnProperty.call(t,o))i(r,t,o);a(r,t);return r};Object.defineProperty(r,"__esModule",{value:true});r.Address4=void 0;const p=c(o(45864));const u=c(o(66437));const l=o(68850);const d=o(95947);const A=o(19973);class Address4{constructor(t){this.groups=u.GROUPS;this.parsedAddress=[];this.parsedSubnet="";this.subnet="/32";this.subnetMask=32;this.v4=true;this.isCorrect=p.isCorrect(u.BITS);this.isInSubnet=p.isInSubnet;this.address=t;const r=u.RE_SUBNET_STRING.exec(t);if(r){this.parsedSubnet=r[0].replace("/","");this.subnetMask=parseInt(this.parsedSubnet,10);this.subnet=`/${this.subnetMask}`;if(this.subnetMask<0||this.subnetMask>u.BITS){throw new l.AddressError("Invalid subnet mask.")}t=t.replace(u.RE_SUBNET_STRING,"")}this.addressMinusSuffix=t;this.parsedAddress=this.parse(t)}static isValid(t){try{new Address4(t);return true}catch(t){return false}}parse(t){const r=t.split(".");if(!t.match(u.RE_ADDRESS)){throw new l.AddressError("Invalid IPv4 address.")}return r}correctForLine truncated
|
||||
/**
|
||||
* @license
|
||||
* Copyright (c) 2010-2012 Mikeal Rogers
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an "AS
|
||||
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
||||
* express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/if(new p.URL(t.url).hostname!==u.hostname){t.headers.delete("authorization");t.headers.delete("cookie")}if(r.status===303||t.method==="POST"&&[301,302].includes(r.status)){i.method="GET";i.body=null;t.headers.delete("content-length")}i.headers={};t.headers.forEach(((t,r)=>{i.headers[r]=t}));i.counter=++t.counter;const l=new a(p.format(u),i);return{request:l,options:i}};const fetch=async(t,r)=>{const o=u.storable(t,r)?await l(t,r):await d(t,r);if(!["GET","HEAD"].includes(t.method)&&o.status>=200&&o.status<=399){await l.invalidate(t,r)}if(!canFollowRedirect(t,o,r)){return o}const i=getRedirect(t,o,r);return fetch(i.request,i.options)};t.exports=fetch},39310:(t,r,o)=>{const{FetchError:i,Headers:a,Request:c,Response:p}=o(88483);const u=o(99824);const l=o(67242);const makeFetchHappen=(t,r)=>{const o=u(r);const i=new c(t,o);return l(i,o)};makeFetchHappen.defaults=(t,r={},o=makeFetchHappen)=>{if(typeof t==="object"){r=t;t=null}const defaultedFetch=(i,a={})=>{const c=i||t;const p={...r,...a,headers:{...r.headers,...a.headers}};return o(c,p)};defaultedFetch.defaults=(t,r={})=>makeFetchHappen.defaults(t,r,defaultedFetch);return defaultedFetch};t.exports=makeFetchHappen;t.exports.FetchError=i;t.exports.Headers=a;t.exports.Request=c;t.exports.Response=p},99824:(t,r,o)=>{const i=o(72250);const a=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"];const configureOptions=t=>{const{strictSSL:r,...o}={...t};o.method=o.method?o.method.toUpperCase():"GET";if(r===undefined||r===null){o.rejectUnauthorized=process.env.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}else{o.rejectUnauthorized=r!==false}if(!o.retry){o.retry={retries:0}}else if(typeof o.retry==="string"){const t=parseInt(o.retry,10);if(isFinite(t)){o.retry={retries:t}}else{o.retry={retries:0}}}else if(typeof o.retry==="number"){o.retry={retries:o.retry}}else{o.retry={retries:0,...o.retry}}o.dns={ttl:5*60*1e3,lookup:i.lookup,...o.dns};o.cache=o.cache||"default";if(o.cache==="default"){const t=Object.keys(o.headers||{}).some((t=>a.includes(t.toLowerCase())));if(t){o.cache="no-store"}}o.cacheAdditionalHeaders=o.cacheAdditionalHeaders||[];if(o.cacheManager&&!o.cachePath){o.cachePath=o.cacheManager}return o};t.exports=configureOptions},22314:(t,r,o)=>{const i=o(52899);class CachingMinipassPipeline extends i{#d=[];#A=new Map;constructor(t,...r){super();this.#d=t.events;if(r.length){this.push(...r)}}on(t,r){if(this.#d.includes(t)&&this.#A.has(t)){return r(...this.#A.get(t))}return super.on(t,r)}emit(t,...r){if(this.#d.includes(t)){this.#A.set(t,r)}return super.emit(t,...r)}}t.exports=CachingMinipassPipeline},20766:(t,r,o)=>{const{Minipass:i}=o(78275);const a=o(88483);const{promiseRetry:c}=o(49498);const p=o(45457);const{log:u}=o(26687);const l=o(22314);const{getAgent:d}=o(57995);const A=o(96734);const b=`${A.name}/${A.version} (+https://npm.im/${A.name})`;const h=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"];const M=["request-timeout"];const remoteFetch=(t,r)=>{const o=d(t.url,{...r,signal:undefined});if(!t.headers.has("connection")){t.headers.set("connection",o?"keep-alive":"close")}if(!t.headers.has("user-agent")){t.headers.set("user-agent",b)}const A={...r,agent:o,redirect:"manual"};return c((async(o,c)=>{const d=new a.Request(t,A);try{let t=await a(d,A);if(A.integrity&&t.status===200){const r=p.integrityStream({algorithms:A.algorithms,integrity:A.integrity,size:A.size});const o=new l({events:["integrity","size"]},t.body,r);r.on("integrity",(t=>o.emit("integrity",t)));r.on("size",(t=>o.emit("size",t)));t=new a.Response(o,t);t.body.hasIntegrityEmitter=true}t.headers.set("x-fetch-attempts",c);const b=i.isStream(d.body);const h=d.method!=="POST"&&!b&&([408,420,429].includes(t.status)||t.status>=500);if(h){if(typeof r.onRetry==="function"){r.onRetry(t)}u.http("fetch",`${d.method} ${d.url} attempt ${c} failed with ${t.status}`);return o(t)}return t}catch(t){const i=t.code==="EPROMISERETRY"?t.retried.code:t.code;const p=t.retried instanceof a.Response||h.includes(i)&&M.includes(t.type);if(d.method==="POST"||p){throw t}if(typeof r.onRetry==="function"){r.onRetry(t)}u.http("fetch",`${d.method} ${d.url} attempt ${c} failed with ${t.code}`);return o(t)}}),r.retry).catch((t=>{if(t.status>=400&&t.type!=="system"){return t}throw t}))};t.exports=remoteFetch},45457:(t,r,o)=>{const i=o(76982);const{Minipass:a}=o(78275);const c=["sha512","sha384","sha256"];const p=["sha512"];const u=i.getHashes();const l=/^[a-z0-9+/]+(?:=?=?)$/i;const d=/^([a-z0-9]+)-([^?]+)(\?[?\S*]*)?$/;const A=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/;const b=/^[\x21-\x7E]+$/;const h=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter((t=>u.includes(t)));const getOptString=t=>t?.length?`?${t.join("?")}`:"";class IntegrityStream extends a{#a;#c;#p;constructor(t){super();this.size=0;this.opts=t;this.#u();if(t?.
Line truncated
|
||||
//! moment-timezone.js
|
||||
//! version : 0.5.43
|
||||
//! version : 0.6.0
|
||||
//! Copyright (c) JS Foundation and other contributors
|
||||
//! license : MIT
|
||||
//! github.com/moment/moment-timezone
|
||||
(function(r,i){"use strict";if(true&&p.exports){p.exports=i(a(9623))}else if(typeof define==="function"&&define.amd){define(["moment"],i)}else{i(r.moment)}})(this,(function(p){"use strict";if(p.version===undefined&&p.default){p=p.default}var r="0.5.43",a={},i={},d={},c={},b={},M;if(!p||typeof p.version!=="string"){logError("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/")}var z=p.version.split("."),u=+z[0],O=+z[1];if(u<2||u===2&&O<6){logError("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+p.version+". See momentjs.com")}function charCodeToInt(p){if(p>96){return p-87}else if(p>64){return p-29}return p-48}function unpackBase60(p){var r=0,a=p.split("."),i=a[0],d=a[1]||"",c=1,b,M=0,z=1;if(p.charCodeAt(0)===45){r=1;z=-1}for(r;r<i.length;r++){b=charCodeToInt(i.charCodeAt(r));M=60*M+b}for(r=0;r<d.length;r++){c=c/60;b=charCodeToInt(d.charCodeAt(r));M+=b*c}return M*z}function arrayToInt(p){for(var r=0;r<p.length;r++){p[r]=unpackBase60(p[r])}}function intToUntil(p,r){for(var a=0;a<r;a++){p[a]=Math.round((p[a-1]||0)+p[a]*6e4)}p[r-1]=Infinity}function mapIndices(p,r){var a=[],i;for(i=0;i<r.length;i++){a[i]=p[r[i]]}return a}function unpack(p){var r=p.split("|"),a=r[2].split(" "),i=r[3].split(""),d=r[4].split(" ");arrayToInt(a);arrayToInt(i);arrayToInt(d);intToUntil(d,i.length);return{name:r[0],abbrs:mapIndices(r[1].split(" "),i),offsets:mapIndices(a,i),untils:d,population:r[5]|0}}function Zone(p){if(p){this._set(unpack(p))}}Zone.prototype={_set:function(p){this.name=p.name;this.abbrs=p.abbrs;this.untils=p.untils;this.offsets=p.offsets;this.population=p.population},_index:function(p){var r=+p,a=this.untils,i;for(i=0;i<a.length;i++){if(r<a[i]){return i}}},countries:function(){var p=this.name;return Object.keys(d).filter((function(r){return d[r].zones.indexOf(p)!==-1}))},parse:function(p){var r=+p,a=this.offsets,i=this.untils,d=i.length-1,c,b,M,z;for(z=0;z<d;z++){c=a[z];b=a[z+1];M=a[z?z-1:z];if(c<b&&tz.moveAmbiguousForward){c=b}else if(c>M&&tz.moveInvalidForward){c=M}if(r<i[z]-c*6e4){return a[z]}}return a[d]},abbr:function(p){return this.abbrs[this._index(p)]},offset:function(p){logError("zone.offset has been deprecated in favor of zone.utcOffset");return this.offsets[this._index(p)]},utcOffset:function(p){return this.offsets[this._index(p)]}};function Country(p,r){this.name=p;this.zones=r}function OffsetAt(p){var r=p.toTimeString();var a=r.match(/\([a-z ]+\)/i);if(a&&a[0]){a=a[0].match(/[A-Z]/g);a=a?a.join(""):undefined}else{a=r.match(/[A-Z]{3,5}/g);a=a?a[0]:undefined}if(a==="GMT"){a=undefined}this.at=+p;this.abbr=a;this.offset=p.getTimezoneOffset()}function ZoneScore(p){this.zone=p;this.offsetScore=0;this.abbrScore=0}ZoneScore.prototype.scoreOffsetAt=function(p){this.offsetScore+=Math.abs(this.zone.utcOffset(p.at)-p.offset);if(this.zone.abbr(p.at).replace(/[^A-Z]/g,"")!==p.abbr){this.abbrScore++}};function findChange(p,r){var a,i;while(i=((r.at-p.at)/12e4|0)*6e4){a=new OffsetAt(new Date(p.at+i));if(a.offset===p.offset){p=a}else{r=a}}return p}function userOffsets(){var p=(new Date).getFullYear()-2,r=new OffsetAt(new Date(p,0,1)),a=[r],i,d,c;for(c=1;c<48;c++){d=new OffsetAt(new Date(p,c,1));if(d.offset!==r.offset){i=findChange(r,d);a.push(i);a.push(new OffsetAt(new Date(i.at+6e4)))}r=d}for(c=0;c<4;c++){a.push(new OffsetAt(new Date(p+c,0,1)));a.push(new OffsetAt(new Date(p+c,6,1)))}return a}function sortZoneScores(p,r){if(p.offsetScore!==r.offsetScore){return p.offsetScore-r.offsetScore}if(p.abbrScore!==r.abbrScore){return p.abbrScore-r.abbrScore}if(p.zone.population!==r.zone.population){return r.zone.population-p.zone.population}return r.zone.name.localeCompare(p.zone.name)}function addToGuesses(p,r){var a,i;arrayToInt(r);for(a=0;a<r.length;a++){i=r[a];b[i]=b[i]||{};b[i][p]=true}}function guessesForUserOffsets(p){var r=p.length,a={},i=[],d,M,z;for(d=0;d<r;d++){z=b[p[d].offset]||{};for(M in z){if(z.hasOwnProperty(M)){a[M]=true}}}for(d in a){if(a.hasOwnProperty(d)){i.push(c[d])}}return i}function rebuildGuess(){try{var p=Intl.DateTimeFormat().resolvedOptions().timeZone;if(p&&p.length>3){var r=c[normalizeName(p)];if(r){return r}logError("Moment Timezone found "+p+" from the Intl api, but did not have that data loaded.")}}catch(p){}var a=userOffsets(),i=a.length,d=guessesForUserOffsets(a),b=[],M,z,u;for(z=0;z<d.length;z++){M=new ZoneScore(getZone(d[z]),i);for(u=0;u<i;u++){M.scoreOffsetAt(a[u])}b.push(M)}b.sort(sortZoneScores);return b.length>0?b[0].zone.name:undefined}function guess(p){if(!M||p){M=rebuildGuess()}return M}function normalizeName(p){return(p||"").toLowerCase().replace(/\//g,"_")}function addZone(p){var r,i,d,b;if(typeof p==="string"){p=[p]}for(r=0;r<p.length;r++){d=p[r].split("|");i=d[0];b=normalizeName(i);a[b]=p[r];c[b]=i;addToGuesses(b,d[2].split(" "))}}function getZone(p,r){p=normalizeName(p);var d=a[p];var b;if(d instanceof Zone){return d}if(typeof d==="string"){d=new Zone(d);a[p]=d;return d}if(i[p]&&r!==getZone&&(b=getZone(i[p],getZone))Line truncated
|
||||
(function(r,i){"use strict";if(true&&t.exports){t.exports=i(o(93350))}else if(typeof define==="function"&&define.amd){define(["moment"],i)}else{i(r.moment)}})(this,(function(t){"use strict";if(t.version===undefined&&t.default){t=t.default}var r="0.6.0",o={},i={},a={},c={},p={},u;if(!t||typeof t.version!=="string"){logError("Moment Timezone requires Moment.js. See https://momentjs.com/timezone/docs/#/use-it/browser/")}var l=t.version.split("."),d=+l[0],A=+l[1];if(d<2||d===2&&A<6){logError("Moment Timezone requires Moment.js >= 2.6.0. You are using Moment.js "+t.version+". See momentjs.com")}function charCodeToInt(t){if(t>96){return t-87}else if(t>64){return t-29}return t-48}function unpackBase60(t){var r=0,o=t.split("."),i=o[0],a=o[1]||"",c=1,p,u=0,l=1;if(t.charCodeAt(0)===45){r=1;l=-1}for(r;r<i.length;r++){p=charCodeToInt(i.charCodeAt(r));u=60*u+p}for(r=0;r<a.length;r++){c=c/60;p=charCodeToInt(a.charCodeAt(r));u+=p*c}return u*l}function arrayToInt(t){for(var r=0;r<t.length;r++){t[r]=unpackBase60(t[r])}}function intToUntil(t,r){for(var o=0;o<r;o++){t[o]=Math.round((t[o-1]||0)+t[o]*6e4)}t[r-1]=Infinity}function mapIndices(t,r){var o=[],i;for(i=0;i<r.length;i++){o[i]=t[r[i]]}return o}function unpack(t){var r=t.split("|"),o=r[2].split(" "),i=r[3].split(""),a=r[4].split(" ");arrayToInt(o);arrayToInt(i);arrayToInt(a);intToUntil(a,i.length);return{name:r[0],abbrs:mapIndices(r[1].split(" "),i),offsets:mapIndices(o,i),untils:a,population:r[5]|0}}function Zone(t){if(t){this._set(unpack(t))}}function closest(t,r){var o=r.length;if(t<r[0]){return 0}else if(o>1&&r[o-1]===Infinity&&t>=r[o-2]){return o-1}else if(t>=r[o-1]){return-1}var i;var a=0;var c=o-1;while(c-a>1){i=Math.floor((a+c)/2);if(r[i]<=t){a=i}else{c=i}}return c}Zone.prototype={_set:function(t){this.name=t.name;this.abbrs=t.abbrs;this.untils=t.untils;this.offsets=t.offsets;this.population=t.population},_index:function(t){var r=+t,o=this.untils,i;i=closest(r,o);if(i>=0){return i}},countries:function(){var t=this.name;return Object.keys(a).filter((function(r){return a[r].zones.indexOf(t)!==-1}))},parse:function(t){var r=+t,o=this.offsets,i=this.untils,a=i.length-1,c,p,u,l;for(l=0;l<a;l++){c=o[l];p=o[l+1];u=o[l?l-1:l];if(c<p&&tz.moveAmbiguousForward){c=p}else if(c>u&&tz.moveInvalidForward){c=u}if(r<i[l]-c*6e4){return o[l]}}return o[a]},abbr:function(t){return this.abbrs[this._index(t)]},offset:function(t){logError("zone.offset has been deprecated in favor of zone.utcOffset");return this.offsets[this._index(t)]},utcOffset:function(t){return this.offsets[this._index(t)]}};function Country(t,r){this.name=t;this.zones=r}function OffsetAt(t){var r=t.toTimeString();var o=r.match(/\([a-z ]+\)/i);if(o&&o[0]){o=o[0].match(/[A-Z]/g);o=o?o.join(""):undefined}else{o=r.match(/[A-Z]{3,5}/g);o=o?o[0]:undefined}if(o==="GMT"){o=undefined}this.at=+t;this.abbr=o;this.offset=t.getTimezoneOffset()}function ZoneScore(t){this.zone=t;this.offsetScore=0;this.abbrScore=0}ZoneScore.prototype.scoreOffsetAt=function(t){this.offsetScore+=Math.abs(this.zone.utcOffset(t.at)-t.offset);if(this.zone.abbr(t.at).replace(/[^A-Z]/g,"")!==t.abbr){this.abbrScore++}};function findChange(t,r){var o,i;while(i=((r.at-t.at)/12e4|0)*6e4){o=new OffsetAt(new Date(t.at+i));if(o.offset===t.offset){t=o}else{r=o}}return t}function userOffsets(){var t=(new Date).getFullYear()-2,r=new OffsetAt(new Date(t,0,1)),o=r.offset,i=[r],a,c,p,u;for(u=1;u<48;u++){p=new Date(t,u,1).getTimezoneOffset();if(p!==o){c=new OffsetAt(new Date(t,u,1));a=findChange(r,c);i.push(a);i.push(new OffsetAt(new Date(a.at+6e4)));r=c;o=p}}for(u=0;u<4;u++){i.push(new OffsetAt(new Date(t+u,0,1)));i.push(new OffsetAt(new Date(t+u,6,1)))}return i}function sortZoneScores(t,r){if(t.offsetScore!==r.offsetScore){return t.offsetScore-r.offsetScore}if(t.abbrScore!==r.abbrScore){return t.abbrScore-r.abbrScore}if(t.zone.population!==r.zone.population){return r.zone.population-t.zone.population}return r.zone.name.localeCompare(t.zone.name)}function addToGuesses(t,r){var o,i;arrayToInt(r);for(o=0;o<r.length;o++){i=r[o];p[i]=p[i]||{};p[i][t]=true}}function guessesForUserOffsets(t){var r=t.length,o={},i=[],a={},u,l,d,A;for(u=0;u<r;u++){d=t[u].offset;if(a.hasOwnProperty(d)){continue}A=p[d]||{};for(l in A){if(A.hasOwnProperty(l)){o[l]=true}}a[d]=true}for(u in o){if(o.hasOwnProperty(u)){i.push(c[u])}}return i}function rebuildGuess(){try{var t=Intl.DateTimeFormat().resolvedOptions().timeZone;if(t&&t.length>3){var r=c[normalizeName(t)];if(r){return r}logError("Moment Timezone found "+t+" from the Intl api, but did not have that data loaded.")}}catch(t){}var o=userOffsets(),i=o.length,a=guessesForUserOffsets(o),p=[],u,l,d;for(l=0;l<a.length;l++){u=new ZoneScore(getZone(a[l]),i);for(d=0;d<i;d++){u.scoreOffsetAt(o[d])}p.push(u)}p.sort(sortZoneScores);return p.length>0?p[0].zone.name:undefined}function guess(t){if(!u||t){u=rebuildGuess()}return u}function normalizeName(t){return(t||"").toLowerCase().replace(/\//g,"_")}function addZone(t){var r,i,a,p;if(typeof t==="string"Line truncated
|
||||
//! moment.js
|
||||
//! version : 2.29.4
|
||||
//! version : 2.30.1
|
||||
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
||||
//! license : MIT
|
||||
//! momentjs.com
|
||||
(function(r,a){true?p.exports=a():0})(this,(function(){"use strict";var r;function hooks(){return r.apply(null,arguments)}function setHookCallback(p){r=p}function isArray(p){return p instanceof Array||Object.prototype.toString.call(p)==="[object Array]"}function isObject(p){return p!=null&&Object.prototype.toString.call(p)==="[object Object]"}function hasOwnProp(p,r){return Object.prototype.hasOwnProperty.call(p,r)}function isObjectEmpty(p){if(Object.getOwnPropertyNames){return Object.getOwnPropertyNames(p).length===0}else{var r;for(r in p){if(hasOwnProp(p,r)){return false}}return true}}function isUndefined(p){return p===void 0}function isNumber(p){return typeof p==="number"||Object.prototype.toString.call(p)==="[object Number]"}function isDate(p){return p instanceof Date||Object.prototype.toString.call(p)==="[object Date]"}function map(p,r){var a=[],i,d=p.length;for(i=0;i<d;++i){a.push(r(p[i],i))}return a}function extend(p,r){for(var a in r){if(hasOwnProp(r,a)){p[a]=r[a]}}if(hasOwnProp(r,"toString")){p.toString=r.toString}if(hasOwnProp(r,"valueOf")){p.valueOf=r.valueOf}return p}function createUTC(p,r,a,i){return createLocalOrUTC(p,r,a,i,true).utc()}function defaultParsingFlags(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidEra:null,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],era:null,meridiem:null,rfc2822:false,weekdayMismatch:false}}function getParsingFlags(p){if(p._pf==null){p._pf=defaultParsingFlags()}return p._pf}var a;if(Array.prototype.some){a=Array.prototype.some}else{a=function(p){var r=Object(this),a=r.length>>>0,i;for(i=0;i<a;i++){if(i in r&&p.call(this,r[i],i,r)){return true}}return false}}function isValid(p){if(p._isValid==null){var r=getParsingFlags(p),i=a.call(r.parsedDateParts,(function(p){return p!=null})),d=!isNaN(p._d.getTime())&&r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&i);if(p._strict){d=d&&r.charsLeftOver===0&&r.unusedTokens.length===0&&r.bigHour===undefined}if(Object.isFrozen==null||!Object.isFrozen(p)){p._isValid=d}else{return d}}return p._isValid}function createInvalid(p){var r=createUTC(NaN);if(p!=null){extend(getParsingFlags(r),p)}else{getParsingFlags(r).userInvalidated=true}return r}var i=hooks.momentProperties=[],d=false;function copyConfig(p,r){var a,d,c,b=i.length;if(!isUndefined(r._isAMomentObject)){p._isAMomentObject=r._isAMomentObject}if(!isUndefined(r._i)){p._i=r._i}if(!isUndefined(r._f)){p._f=r._f}if(!isUndefined(r._l)){p._l=r._l}if(!isUndefined(r._strict)){p._strict=r._strict}if(!isUndefined(r._tzm)){p._tzm=r._tzm}if(!isUndefined(r._isUTC)){p._isUTC=r._isUTC}if(!isUndefined(r._offset)){p._offset=r._offset}if(!isUndefined(r._pf)){p._pf=getParsingFlags(r)}if(!isUndefined(r._locale)){p._locale=r._locale}if(b>0){for(a=0;a<b;a++){d=i[a];c=r[d];if(!isUndefined(c)){p[d]=c}}}return p}function Moment(p){copyConfig(this,p);this._d=new Date(p._d!=null?p._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN)}if(d===false){d=true;hooks.updateOffset(this);d=false}}function isMoment(p){return p instanceof Moment||p!=null&&p._isAMomentObject!=null}function warn(p){if(hooks.suppressDeprecationWarnings===false&&typeof console!=="undefined"&&console.warn){console.warn("Deprecation warning: "+p)}}function deprecate(p,r){var a=true;return extend((function(){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(null,p)}if(a){var i=[],d,c,b,M=arguments.length;for(c=0;c<M;c++){d="";if(typeof arguments[c]==="object"){d+="\n["+c+"] ";for(b in arguments[0]){if(hasOwnProp(arguments[0],b)){d+=b+": "+arguments[0][b]+", "}}d=d.slice(0,-2)}else{d=arguments[c]}i.push(d)}warn(p+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack);a=false}return r.apply(this,arguments)}),r)}var c={};function deprecateSimple(p,r){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(p,r)}if(!c[p]){warn(r);c[p]=true}}hooks.suppressDeprecationWarnings=false;hooks.deprecationHandler=null;function isFunction(p){return typeof Function!=="undefined"&&p instanceof Function||Object.prototype.toString.call(p)==="[object Function]"}function set(p){var r,a;for(a in p){if(hasOwnProp(p,a)){r=p[a];if(isFunction(r)){this[a]=r}else{this["_"+a]=r}}}this._config=p;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(p,r){var a=extend({},p),i;for(i in r){if(hasOwnProp(r,i)){if(isObject(p[i])&&isObject(r[i])){a[i]={};extend(a[i],p[i]);extend(a[i],r[i])}else if(r[i]!=null){a[i]=r[i]}else{delete a[i]}}}for(i in p){if(hasOwnProp(p,i)&&!hasOwnProp(r,i)&&isObject(p[i])){a[i]=extend({},a[i])}}return a}function Locale(p){if(p!=null){this.set(p)}}var b;if(Object.keys){b=Object.keys}else{b=function(p){var r,a=[];for(r in p){if(hasOwnProp(p,r)){a.push(r)}}return a}}var M={sameDay:Line truncated
|
||||
(function(t,o){true?r.exports=o():0})(this,(function(){"use strict";var o;function hooks(){return o.apply(null,arguments)}function setHookCallback(t){o=t}function isArray(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function isObject(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function hasOwnProp(t,r){return Object.prototype.hasOwnProperty.call(t,r)}function isObjectEmpty(t){if(Object.getOwnPropertyNames){return Object.getOwnPropertyNames(t).length===0}else{var r;for(r in t){if(hasOwnProp(t,r)){return false}}return true}}function isUndefined(t){return t===void 0}function isNumber(t){return typeof t==="number"||Object.prototype.toString.call(t)==="[object Number]"}function isDate(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function map(t,r){var o=[],i,a=t.length;for(i=0;i<a;++i){o.push(r(t[i],i))}return o}function extend(t,r){for(var o in r){if(hasOwnProp(r,o)){t[o]=r[o]}}if(hasOwnProp(r,"toString")){t.toString=r.toString}if(hasOwnProp(r,"valueOf")){t.valueOf=r.valueOf}return t}function createUTC(t,r,o,i){return createLocalOrUTC(t,r,o,i,true).utc()}function defaultParsingFlags(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidEra:null,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],era:null,meridiem:null,rfc2822:false,weekdayMismatch:false}}function getParsingFlags(t){if(t._pf==null){t._pf=defaultParsingFlags()}return t._pf}var i;if(Array.prototype.some){i=Array.prototype.some}else{i=function(t){var r=Object(this),o=r.length>>>0,i;for(i=0;i<o;i++){if(i in r&&t.call(this,r[i],i,r)){return true}}return false}}function isValid(t){var r=null,o=false,a=t._d&&!isNaN(t._d.getTime());if(a){r=getParsingFlags(t);o=i.call(r.parsedDateParts,(function(t){return t!=null}));a=r.overflow<0&&!r.empty&&!r.invalidEra&&!r.invalidMonth&&!r.invalidWeekday&&!r.weekdayMismatch&&!r.nullInput&&!r.invalidFormat&&!r.userInvalidated&&(!r.meridiem||r.meridiem&&o);if(t._strict){a=a&&r.charsLeftOver===0&&r.unusedTokens.length===0&&r.bigHour===undefined}}if(Object.isFrozen==null||!Object.isFrozen(t)){t._isValid=a}else{return a}return t._isValid}function createInvalid(t){var r=createUTC(NaN);if(t!=null){extend(getParsingFlags(r),t)}else{getParsingFlags(r).userInvalidated=true}return r}var a=hooks.momentProperties=[],c=false;function copyConfig(t,r){var o,i,c,p=a.length;if(!isUndefined(r._isAMomentObject)){t._isAMomentObject=r._isAMomentObject}if(!isUndefined(r._i)){t._i=r._i}if(!isUndefined(r._f)){t._f=r._f}if(!isUndefined(r._l)){t._l=r._l}if(!isUndefined(r._strict)){t._strict=r._strict}if(!isUndefined(r._tzm)){t._tzm=r._tzm}if(!isUndefined(r._isUTC)){t._isUTC=r._isUTC}if(!isUndefined(r._offset)){t._offset=r._offset}if(!isUndefined(r._pf)){t._pf=getParsingFlags(r)}if(!isUndefined(r._locale)){t._locale=r._locale}if(p>0){for(o=0;o<p;o++){i=a[o];c=r[i];if(!isUndefined(c)){t[i]=c}}}return t}function Moment(t){copyConfig(this,t);this._d=new Date(t._d!=null?t._d.getTime():NaN);if(!this.isValid()){this._d=new Date(NaN)}if(c===false){c=true;hooks.updateOffset(this);c=false}}function isMoment(t){return t instanceof Moment||t!=null&&t._isAMomentObject!=null}function warn(t){if(hooks.suppressDeprecationWarnings===false&&typeof console!=="undefined"&&console.warn){console.warn("Deprecation warning: "+t)}}function deprecate(t,r){var o=true;return extend((function(){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(null,t)}if(o){var i=[],a,c,p,u=arguments.length;for(c=0;c<u;c++){a="";if(typeof arguments[c]==="object"){a+="\n["+c+"] ";for(p in arguments[0]){if(hasOwnProp(arguments[0],p)){a+=p+": "+arguments[0][p]+", "}}a=a.slice(0,-2)}else{a=arguments[c]}i.push(a)}warn(t+"\nArguments: "+Array.prototype.slice.call(i).join("")+"\n"+(new Error).stack);o=false}return r.apply(this,arguments)}),r)}var p={};function deprecateSimple(t,r){if(hooks.deprecationHandler!=null){hooks.deprecationHandler(t,r)}if(!p[t]){warn(r);p[t]=true}}hooks.suppressDeprecationWarnings=false;hooks.deprecationHandler=null;function isFunction(t){return typeof Function!=="undefined"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function set(t){var r,o;for(o in t){if(hasOwnProp(t,o)){r=t[o];if(isFunction(r)){this[o]=r}else{this["_"+o]=r}}}this._config=t;this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(t,r){var o=extend({},t),i;for(i in r){if(hasOwnProp(r,i)){if(isObject(t[i])&&isObject(r[i])){o[i]={};extend(o[i],t[i]);extend(o[i],r[i])}else if(r[i]!=null){o[i]=r[i]}else{delete o[i]}}}for(i in t){if(hasOwnProp(t,i)&&!hasOwnProp(r,i)&&isObject(t[i])){o[i]=extend({},o[i])}}return o}function Locale(t){if(t!=null){this.set(t)}}var u;if(Object.keys){u=Object.keys}else{u=function(t){var r,o=[];for(r in t){if(hasOwnProp(t,r)){o.push(r)}}return o}}var l={sLine truncated
|
||||
//! moment.js
|
||||
hooks.version="2.29.4";setHookCallback(createLocal);hooks.fn=Ye;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=Ye;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};return hooks}))},467:(p,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});function _interopDefault(p){return p&&typeof p==="object"&&"default"in p?p["default"]:p}var i=_interopDefault(a(2781));var d=_interopDefault(a(3685));var c=_interopDefault(a(7310));var b=_interopDefault(a(8665));var M=_interopDefault(a(5687));var z=_interopDefault(a(9796));const u=i.Readable;const O=Symbol("buffer");const l=Symbol("type");class Blob{constructor(){this[l]="";const p=arguments[0];const r=arguments[1];const a=[];let i=0;if(p){const r=p;const d=Number(r.length);for(let p=0;p<d;p++){const d=r[p];let c;if(d instanceof Buffer){c=d}else if(ArrayBuffer.isView(d)){c=Buffer.from(d.buffer,d.byteOffset,d.byteLength)}else if(d instanceof ArrayBuffer){c=Buffer.from(d)}else if(d instanceof Blob){c=d[O]}else{c=Buffer.from(typeof d==="string"?d:String(d))}i+=c.length;a.push(c)}}this[O]=Buffer.concat(a);let d=r&&r.type!==undefined&&String(r.type).toLowerCase();if(d&&!/[^\u0020-\u007E]/.test(d)){this[l]=d}}get size(){return this[O].length}get type(){return this[l]}text(){return Promise.resolve(this[O].toString())}arrayBuffer(){const p=this[O];const r=p.buffer.slice(p.byteOffset,p.byteOffset+p.byteLength);return Promise.resolve(r)}stream(){const p=new u;p._read=function(){};p.push(this[O]);p.push(null);return p}toString(){return"[object Blob]"}slice(){const p=this.size;const r=arguments[0];const a=arguments[1];let i,d;if(r===undefined){i=0}else if(r<0){i=Math.max(p+r,0)}else{i=Math.min(r,p)}if(a===undefined){d=p}else if(a<0){d=Math.max(p+a,0)}else{d=Math.min(a,p)}const c=Math.max(d-i,0);const b=this[O];const M=b.slice(i,i+c);const z=new Blob([],{type:arguments[2]});z[O]=M;return z}}Object.defineProperties(Blob.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});Object.defineProperty(Blob.prototype,Symbol.toStringTag,{value:"Blob",writable:false,enumerable:false,configurable:true});function FetchError(p,r,a){Error.call(this,p);this.message=p;this.type=r;if(a){this.code=this.errno=a.code}Error.captureStackTrace(this,this.constructor)}FetchError.prototype=Object.create(Error.prototype);FetchError.prototype.constructor=FetchError;FetchError.prototype.name="FetchError";let A;try{A=a(2877).convert}catch(p){}const m=Symbol("Body internals");const q=i.PassThrough;function Body(p){var r=this;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},d=a.size;let c=d===undefined?0:d;var b=a.timeout;let M=b===undefined?0:b;if(p==null){p=null}else if(isURLSearchParams(p)){p=Buffer.from(p.toString())}else if(isBlob(p));else if(Buffer.isBuffer(p));else if(Object.prototype.toString.call(p)==="[object ArrayBuffer]"){p=Buffer.from(p)}else if(ArrayBuffer.isView(p)){p=Buffer.from(p.buffer,p.byteOffset,p.byteLength)}else if(p instanceof i);else{p=Buffer.from(String(p))}this[m]={body:p,disturbed:false,error:null};this.size=c;this.timeout=M;if(p instanceof i){p.on("error",(function(p){const a=p.name==="AbortError"?p:new FetchError(`Invalid response body while trying to fetch ${r.url}: ${p.message}`,"system",p);r[m].error=a}))}}Body.prototype={get body(){return this[m].body},get bodyUsed(){return this[m].disturbed},arrayBuffer(){return consumeBody.call(this).then((function(p){return p.buffer.slice(p.byteOffset,p.byteOffset+p.byteLength)}))},blob(){let p=this.headers&&this.headers.get("content-type")||"";return consumeBody.call(this).then((function(r){return Object.assign(new Blob([],{type:p.toLowerCase()}),{[O]:r})}))},json(){var p=this;return consumeBody.call(this).then((function(r){try{return JSON.parse(r.toString())}catch(r){return Body.Promise.reject(new FetchError(`invalid json response body at ${p.url} reason: ${r.message}`,"invalid-json"))}}))},text(){return consumeBody.call(this).then((function(p){return p.toString()}))},buffer(){return consumeBody.call(this)},textConverted(){var p=this;return consumeBody.call(this).then((function(r){return coLine truncated
|
||||
hooks.version="2.30.1";setHookCallback(createLocal);hooks.fn=Ke;hooks.min=min;hooks.max=max;hooks.now=now;hooks.utc=createUTC;hooks.unix=createUnix;hooks.months=listMonths;hooks.isDate=isDate;hooks.locale=getSetGlobalLocale;hooks.invalid=createInvalid;hooks.duration=createDuration;hooks.isMoment=isMoment;hooks.weekdays=listWeekdays;hooks.parseZone=createInZone;hooks.localeData=getLocale;hooks.isDuration=isDuration;hooks.monthsShort=listMonthsShort;hooks.weekdaysMin=listWeekdaysMin;hooks.defineLocale=defineLocale;hooks.updateLocale=updateLocale;hooks.locales=listLocales;hooks.weekdaysShort=listWeekdaysShort;hooks.normalizeUnits=normalizeUnits;hooks.relativeTimeRounding=getSetRelativeTimeRounding;hooks.relativeTimeThreshold=getSetRelativeTimeThreshold;hooks.calendarFormat=getCalendarFormat;hooks.prototype=Ke;hooks.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};return hooks}))},70744:t=>{var r=1e3;var o=r*60;var i=o*60;var a=i*24;var c=a*7;var p=a*365.25;t.exports=function(t,r){r=r||{};var o=typeof t;if(o==="string"&&t.length>0){return parse(t)}else if(o==="number"&&isFinite(t)){return r.long?fmtLong(t):fmtShort(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function parse(t){t=String(t);if(t.length>100){return}var u=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!u){return}var l=parseFloat(u[1]);var d=(u[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return l*p;case"weeks":case"week":case"w":return l*c;case"days":case"day":case"d":return l*a;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*o;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return undefined}}function fmtShort(t){var c=Math.abs(t);if(c>=a){return Math.round(t/a)+"d"}if(c>=i){return Math.round(t/i)+"h"}if(c>=o){return Math.round(t/o)+"m"}if(c>=r){return Math.round(t/r)+"s"}return t+"ms"}function fmtLong(t){var c=Math.abs(t);if(c>=a){return plural(t,c,a,"day")}if(c>=i){return plural(t,c,i,"hour")}if(c>=o){return plural(t,c,o,"minute")}if(c>=r){return plural(t,c,r,"second")}return t+" ms"}function plural(t,r,o,i){var a=r>=o*1.5;return Math.round(t/o)+" "+i+(a?"s":"")}},60668:(t,r,o)=>{
|
||||
/*!
|
||||
* negotiator
|
||||
* Copyright(c) 2012 Federico Romero
|
||||
* Copyright(c) 2012-2014 Isaac Z. Schlueter
|
||||
* Copyright(c) 2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
var i=o(79168);var a=o(25111);var c=o(56008);var p=o(53672);t.exports=Negotiator;t.exports.Negotiator=Negotiator;function Negotiator(t){if(!(this instanceof Negotiator)){return new Negotiator(t)}this.request=t}Negotiator.prototype.charset=function charset(t){var r=this.charsets(t);return r&&r[0]};Negotiator.prototype.charsets=function charsets(t){return i(this.request.headers["accept-charset"],t)};Negotiator.prototype.encoding=function encoding(t,r){var o=this.encodings(t,r);return o&&o[0]};Negotiator.prototype.encodings=function encodings(t,r){var o=r||{};return a(this.request.headers["accept-encoding"],t,o.preferred)};Negotiator.prototype.language=function language(t){var r=this.languages(t);return r&&r[0]};Negotiator.prototype.languages=function languages(t){return c(this.request.headers["accept-language"],t)};Negotiator.prototype.mediaType=function mediaType(t){var r=this.mediaTypes(t);return r&&r[0]};Negotiator.prototype.mediaTypes=function mediaTypes(t){return p(this.request.headers.accept,t)};Negotiator.prototype.preferredCharset=Negotiator.prototype.charset;Negotiator.prototype.preferredCharsets=Negotiator.prototype.charsets;Negotiator.prototype.preferredEncoding=Negotiator.prototype.encoding;Negotiator.prototype.preferredEncodings=Negotiator.prototype.encodings;Negotiator.prototype.preferredLanguage=Negotiator.prototype.language;Negotiator.prototype.preferredLanguages=Negotiator.prototype.languages;Negotiator.prototype.preferredMediaType=Negotiator.prototype.mediaType;Negotiator.prototype.preferredMediaTypes=Negotiator.prototype.mediaTypes},79168:t=>{t.exports=preferredCharsets;t.exports.preferredCharsets=preferredCharsets;var r=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptCharset(t){var r=t.split(",");for(var o=0,i=0;o<r.length;o++){var a=parseCharset(r[o].trim(),o);if(a){r[i++]=a}}r.length=i;return r}function parseCharset(t,o){var i=r.exec(t);if(!i)return null;var a=i[1];var c=1;if(i[2]){var p=i[2].split(";");for(var u=0;u<p.length;u++){var l=p[u].trim().split("=");if(l[0]==="q"){c=parseFloat(l[1]);break}}}return{charset:a,q:c,i:o}}function getCharsetPriority(t,r,o){var i={o:-1,q:0,s:0};for(var a=0;a<r.length;a++){var c=specify(t,r[a],o);if(c&&(i.s-c.s||i.q-c.q||i.o-c.o)<0){i=c}}return i}function specify(t,r,o){var i=0;if(r.charset.toLowerCase()===t.toLowerCase()){i|=1}else if(r.charset!=="*"){return null}return{i:o,o:r.i,q:r.q,s:i}}function preferredCharsets(t,r){var o=parseAcceptCharset(t===undefined?"*":t||"");if(!r){return o.filter(isQuality).sort(compareSpecs).map(getFullCharset)}var i=r.map((function getPriority(t,r){return getCharsetPriority(t,o,r)}));return i.filter(isQuality).sort(compareSpecs).map((function getCharset(t){return r[i.indexOf(t)]}))}function compareSpecs(t,r){return r.q-t.q||r.s-t.s||t.o-r.o||t.i-r.i||0}function getFullCharset(t){return t.charset}function isQuality(t){return t.q>0}},25111:t=>{t.exports=preferredEncodings;t.exports.preferredEncodings=preferredEncodings;var r=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function parseAcceptEncoding(t){var r=t.split(",");var o=false;var i=1;for(var a=0,c=0;a<r.length;a++){var p=parseEncoding(r[a].trim(),a);if(p){r[c++]=p;o=o||specify("identity",p);i=Math.min(i,p.q||1)}}if(!o){r[c++]={encoding:"identity",q:i,i:a}}r.length=c;return r}function parseEncoding(t,o){var i=r.exec(t);if(!i)return null;var a=i[1];var c=1;if(i[2]){var p=i[2].split(";");for(var u=0;u<p.length;u++){var l=p[u].trim().split("=");if(l[0]==="q"){c=parseFloat(l[1]);break}}}return{encoding:a,q:c,i:o}}function getEncodingPriority(t,r,o){var i={encoding:t,o:-1,q:0,s:0};for(var a=0;a<r.length;a++){var c=specify(t,r[a],o);if(c&&(i.s-c.s||i.q-c.q||i.o-c.o)<0){i=c}}return i}function specify(t,r,o){var i=0;if(r.encoding.toLowerCase()===t.toLowerCase()){i|=1}else if(r.encoding!=="*"){return null}return{encoding:t,i:o,o:r.i,q:r.q,s:i}}function preferredEncodings(t,r,o){var i=parseAcceptEncoding(t||"");var a=o?function comparator(t,r){if(t.q!==r.q){return r.q-t.q}var i=o.indexOf(t.encoding);var a=o.indexOf(r.encoding);if(i===-1&&a===-1){return r.s-t.s||t.o-r.o||t.i-r.i}if(i!==-1&&a!==-1){return i-a}return i===-1?1:-1}:compareSpecs;if(!r){return i.filter(isQuality).sort(a).map(getFullEncoding)}var c=r.map((function getPriority(t,r){return getEncodingPriority(t,i,r)}));return c.filter(isQuality).sort(a).map((function getEncoding(t){return r[c.indexOf(t)]}))}function compareSpecs(t,r){return r.q-t.q||r.s-t.s||t.o-r.o||t.i-r.i}function getFullEncoding(t){return t.encoding}function isQuality(t){return t.q>0}},56008:t=>{t.exports=preferredLanguages;t.exports.preferredLanguages=preferredLanguages;var r=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function parseAcceptLanguage(t){var r=t.split(",");for(var o=0,i=0;o<r.length;o++){var a=parseLanguage(r[o].trim(),o);if(a){r[i++]=a}}r.length=i;return r}function parseLanguage(t,o){var i=r.exec(t);if(!i)return null;var a=i[1];var c=i[2];var p=a;if(c)p+="-"+c;var u=1;if(i[3]){var l=i[3].split(";");for(var d=0;d<l.length;d++){var A=l[d].split(Line truncated
|
||||
/*!
|
||||
* Tmp
|
||||
*
|
||||
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
|
||||
*
|
||||
* MIT Licensed
|
||||
*/
|
||||
const i=a(7147);const d=a(2037);const c=a(1017);const b=a(6113);const M={fs:i.constants,os:d.constants};const z=a(4959);const u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",O=/XXXXXX/,l=3,A=(M.O_CREAT||M.fs.O_CREAT)|(M.O_EXCL||M.fs.O_EXCL)|(M.O_RDWR||M.fs.O_RDWR),m=d.platform()==="win32",q=M.EBADF||M.os.errno.EBADF,h=M.ENOENT||M.os.errno.ENOENT,W=448,g=384,v="exit",R=[],_=i.rmdirSync.bind(i),L=z.sync;let w=false;function tmpName(p,r){const a=_parseArguments(p,r),d=a[0],c=a[1];try{_assertAndSanitizeOptions(d)}catch(p){return c(p)}let b=d.tries;(function _getUniqueName(){try{const p=_generateTmpName(d);i.stat(p,(function(r){if(!r){if(b-- >0)return _getUniqueName();return c(new Error("Could not get a unique tmp filename, max tries reached "+p))}c(null,p)}))}catch(p){c(p)}})()}function tmpNameSync(p){const r=_parseArguments(p),a=r[0];_assertAndSanitizeOptions(a);let d=a.tries;do{const p=_generateTmpName(a);try{i.statSync(p)}catch(r){return p}}while(d-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(p,r){const a=_parseArguments(p,r),d=a[0],c=a[1];tmpName(d,(function _tmpNameCreated(p,r){if(p)return c(p);i.open(r,A,d.mode||g,(function _fileCreated(p,a){if(p)return c(p);if(d.discardDescriptor){return i.close(a,(function _discardCallback(p){return c(p,r,undefined,_prepareTmpFileRemoveCallback(r,-1,d,false))}))}else{const p=d.discardDescriptor||d.detachDescriptor;c(null,r,a,_prepareTmpFileRemoveCallback(r,p?-1:a,d,false))}}))}))}function fileSync(p){const r=_parseArguments(p),a=r[0];const d=a.discardDescriptor||a.detachDescriptor;const c=tmpNameSync(a);var b=i.openSync(c,A,a.mode||g);if(a.discardDescriptor){i.closeSync(b);b=undefined}return{name:c,fd:b,removeCallback:_prepareTmpFileRemoveCallback(c,d?-1:b,a,true)}}function dir(p,r){const a=_parseArguments(p,r),d=a[0],c=a[1];tmpName(d,(function _tmpNameCreated(p,r){if(p)return c(p);i.mkdir(r,d.mode||W,(function _dirCreated(p){if(p)return c(p);c(null,r,_prepareTmpDirRemoveCallback(r,d,false))}))}))}function dirSync(p){const r=_parseArguments(p),a=r[0];const d=tmpNameSync(a);i.mkdirSync(d,a.mode||W);return{name:d,removeCallback:_prepareTmpDirRemoveCallback(d,a,true)}}function _removeFileAsync(p,r){const _handler=function(p){if(p&&!_isENOENT(p)){return r(p)}r()};if(0<=p[0])i.close(p[0],(function(){i.unlink(p[1],_handler)}));else i.unlink(p[1],_handler)}function _removeFileSync(p){let r=null;try{if(0<=p[0])i.closeSync(p[0])}catch(p){if(!_isEBADF(p)&&!_isENOENT(p))throw p}finally{try{i.unlinkSync(p[1])}catch(p){if(!_isENOENT(p))r=p}}if(r!==null){throw r}}function _prepareTmpFileRemoveCallback(p,r,a,i){const d=_prepareRemoveCallback(_removeFileSync,[r,p],i);const c=_prepareRemoveCallback(_removeFileAsync,[r,p],i,d);if(!a.keep)R.unshift(d);return i?d:c}function _prepareTmpDirRemoveCallback(p,r,a){const d=r.unsafeCleanup?z:i.rmdir.bind(i);const c=r.unsafeCleanup?L:_;const b=_prepareRemoveCallback(c,p,a);const M=_prepareRemoveCallback(d,p,a,b);if(!r.keep)R.unshift(b);return a?b:M}function _prepareRemoveCallback(p,r,a,i){let d=false;return function _cleanupCallback(c){if(!d){const b=i||_cleanupCallback;const M=R.indexOf(b);if(M>=0)R.splice(M,1);d=true;if(a||p===_||p===L){return p(r)}else{return p(r,c||function(){})}}}}function _garbageCollector(){if(!w)return;while(R.length){try{R[0]()}catch(p){}}}function _randomChars(p){let r=[],a=null;try{a=b.randomBytes(p)}catch(r){a=b.pseudoRandomBytes(p)}for(var i=0;i<p;i++){r.push(u[a[i]%u.length])}return r.join("")}function _isBlank(p){return p===null||_isUndefined(p)||!p.trim()}function _isUndefined(p){return typeof p==="undefined"}function _parseArguments(p,r){if(typeof p==="function"){return[{},p]}if(_isUndefined(p)){return[{},r]}const a={};for(const r of Object.getOwnPropertyNames(p)){a[r]=p[r]}return[a,r]}function _generateTmpName(p){const r=p.tmpdir;if(!_isUndefined(p.name))return c.join(r,p.dir,p.name);if(!_isUndefined(p.template))return c.join(r,p.dir,p.template).replace(O,_randomChars(6));const a=[p.prefix?p.prefix:"tmp","-",process.pid,"-",_randomChars(12),p.postfix?"-"+p.postfix:""].join("");return c.join(r,p.dir,a)}function _assertAndSanitizeOptions(p){p.tmpdir=_getTmpDir(p);const r=p.tmpdir;if(!_isUndefined(p.name))_assertIsRelative(p.name,"name",r);if(!_isUndefined(p.dir))_assertIsRelative(p.dir,"dir",r);if(!_isUndefined(p.template)){_assertIsRelative(p.template,"template",r);if(!p.template.match(O))throw new Error(`Invalid template, found "${p.template}".`)}if(!_isUndefined(p.tries)&&isNaN(p.tries)||p.tries<0)throw new Error(`Invalid tries, found "${p.tries}".`);p.tries=_isUndefined(p.name)?p.tries||l:1;p.keep=!!p.keep;p.detachDescriptor=!!p.detachDescriptor;p.discardDescriptor=!!p.discardDescriptor;p.unsafeCleanup=!!p.unsafeCleanup;p.dir=_isUndefined(p.dir)?"":c.relative(r,_resolvePath(p.dir,r));p.template=_isUndefined(p.template)?undefined:c.relative(r,_resolvePath(p.template,r));p.template=_isBlank(p.template)?undefined:c.relative(p.dir,p.template);p.naLine truncated
|
||||
*/const a=o(79896);const c=o(70857);const p=o(16928);const u=o(76982);const l={fs:a.constants,os:c.constants};const d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",A=/XXXXXX/,b=3,h=(l.O_CREAT||l.fs.O_CREAT)|(l.O_EXCL||l.fs.O_EXCL)|(l.O_RDWR||l.fs.O_RDWR),M=c.platform()==="win32",g=l.EBADF||l.os.errno.EBADF,z=l.ENOENT||l.os.errno.ENOENT,O=448,y=384,C="exit",B=[],I=a.rmdirSync.bind(a);let R=false;function rimraf(t,r){return a.rm(t,{recursive:true},r)}function FN_RIMRAF_SYNC(t){return a.rmSync(t,{recursive:true})}function tmpName(t,r){const o=_parseArguments(t,r),i=o[0],c=o[1];_assertAndSanitizeOptions(i,(function(t,r){if(t)return c(t);let o=r.tries;(function _getUniqueName(){try{const t=_generateTmpName(r);a.stat(t,(function(r){if(!r){if(o-- >0)return _getUniqueName();return c(new Error("Could not get a unique tmp filename, max tries reached "+t))}c(null,t)}))}catch(t){c(t)}})()}))}function tmpNameSync(t){const r=_parseArguments(t),o=r[0];const i=_assertAndSanitizeOptionsSync(o);let c=i.tries;do{const t=_generateTmpName(i);try{a.statSync(t)}catch(r){return t}}while(c-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(t,r){const o=_parseArguments(t,r),i=o[0],c=o[1];tmpName(i,(function _tmpNameCreated(t,r){if(t)return c(t);a.open(r,h,i.mode||y,(function _fileCreated(t,o){if(t)return c(t);if(i.discardDescriptor){return a.close(o,(function _discardCallback(t){return c(t,r,undefined,_prepareTmpFileRemoveCallback(r,-1,i,false))}))}else{const t=i.discardDescriptor||i.detachDescriptor;c(null,r,o,_prepareTmpFileRemoveCallback(r,t?-1:o,i,false))}}))}))}function fileSync(t){const r=_parseArguments(t),o=r[0];const i=o.discardDescriptor||o.detachDescriptor;const c=tmpNameSync(o);let p=a.openSync(c,h,o.mode||y);if(o.discardDescriptor){a.closeSync(p);p=undefined}return{name:c,fd:p,removeCallback:_prepareTmpFileRemoveCallback(c,i?-1:p,o,true)}}function dir(t,r){const o=_parseArguments(t,r),i=o[0],c=o[1];tmpName(i,(function _tmpNameCreated(t,r){if(t)return c(t);a.mkdir(r,i.mode||O,(function _dirCreated(t){if(t)return c(t);c(null,r,_prepareTmpDirRemoveCallback(r,i,false))}))}))}function dirSync(t){const r=_parseArguments(t),o=r[0];const i=tmpNameSync(o);a.mkdirSync(i,o.mode||O);return{name:i,removeCallback:_prepareTmpDirRemoveCallback(i,o,true)}}function _removeFileAsync(t,r){const _handler=function(t){if(t&&!_isENOENT(t)){return r(t)}r()};if(0<=t[0])a.close(t[0],(function(){a.unlink(t[1],_handler)}));else a.unlink(t[1],_handler)}function _removeFileSync(t){let r=null;try{if(0<=t[0])a.closeSync(t[0])}catch(t){if(!_isEBADF(t)&&!_isENOENT(t))throw t}finally{try{a.unlinkSync(t[1])}catch(t){if(!_isENOENT(t))r=t}}if(r!==null){throw r}}function _prepareTmpFileRemoveCallback(t,r,o,i){const a=_prepareRemoveCallback(_removeFileSync,[r,t],i);const c=_prepareRemoveCallback(_removeFileAsync,[r,t],i,a);if(!o.keep)B.unshift(a);return i?a:c}function _prepareTmpDirRemoveCallback(t,r,o){const i=r.unsafeCleanup?rimraf:a.rmdir.bind(a);const c=r.unsafeCleanup?FN_RIMRAF_SYNC:I;const p=_prepareRemoveCallback(c,t,o);const u=_prepareRemoveCallback(i,t,o,p);if(!r.keep)B.unshift(p);return o?p:u}function _prepareRemoveCallback(t,r,o,i){let a=false;return function _cleanupCallback(c){if(!a){const p=i||_cleanupCallback;const u=B.indexOf(p);if(u>=0)B.splice(u,1);a=true;if(o||t===I||t===FN_RIMRAF_SYNC){return t(r)}else{return t(r,c||function(){})}}}}function _garbageCollector(){if(!R)return;while(B.length){try{B[0]()}catch(t){}}}function _randomChars(t){let r=[],o=null;try{o=u.randomBytes(t)}catch(r){o=u.pseudoRandomBytes(t)}for(let i=0;i<t;i++){r.push(d[o[i]%d.length])}return r.join("")}function _isUndefined(t){return typeof t==="undefined"}function _parseArguments(t,r){if(typeof t==="function"){return[{},t]}if(_isUndefined(t)){return[{},r]}const o={};for(const r of Object.getOwnPropertyNames(t)){o[r]=t[r]}return[o,r]}function _resolvePath(t,r,o){const i=p.isAbsolute(t)?t:p.join(r,t);a.stat(i,(function(t){if(t){a.realpath(p.dirname(i),(function(t,r){if(t)return o(t);o(null,p.join(r,p.basename(i)))}))}else{a.realpath(i,o)}}))}function _resolvePathSync(t,r){const o=p.isAbsolute(t)?t:p.join(r,t);try{a.statSync(o);return a.realpathSync(o)}catch(t){const r=a.realpathSync(p.dirname(o));return p.join(r,p.basename(o))}}function _generateTmpName(t){const r=t.tmpdir;if(!_isUndefined(t.name)){return p.join(r,t.dir,t.name)}if(!_isUndefined(t.template)){return p.join(r,t.dir,t.template).replace(A,_randomChars(6))}const o=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_randomChars(12),t.postfix?"-"+t.postfix:""].join("");return p.join(r,t.dir,o)}function _assertOptionsBase(t){if(!_isUndefined(t.name)){const r=t.name;if(p.isAbsolute(r))throw new Error(`name option must not contain an absolute path, found "${r}".`);const o=p.basename(r);if(o===".."||o==="."||o!==r)throw new Error(`name option must not contain a path, found "${r}".`)}if(!_isUndefined(t.template)&&!t.template.match(A)){throw new Error(`Invalid teLine truncated
|
||||
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=t=>t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=t=>t.replace(/\r?\n|\r/g,"\r\n");const i=[];const a=new Uint8Array([13,10]);A=0;let c=false;for(const[r,p]of t){if(typeof p==="string"){const t=q.encode(o+`; name="${escape(normalizeLinefeeds(r))}"`+`\r\n\r\n${normalizeLinefeeds(p)}\r\n`);i.push(t);A+=t.byteLength}else{const t=q.encode(`${o}; name="${escape(normalizeLinefeeds(r))}"`+(p.name?`; filename="${escape(p.name)}"`:"")+"\r\n"+`Content-Type: ${p.type||"application/octet-stream"}\r\n\r\n`);i.push(t,p,a);if(typeof p.size==="number"){A+=t.byteLength+p.size+a.byteLength}else{c=true}}}const p=q.encode(`--${r}--\r\n`);i.push(p);A+=p.byteLength;if(c){A=null}d=t;l=async function*(){for(const t of i){if(t.stream){yield*t.stream()}else{yield t}}};b=`multipart/form-data; boundary=${r}`}else if(c(t)){d=t;A=t.size;if(t.type){b=t.type}}else if(typeof t[Symbol.asyncIterator]==="function"){if(r){throw new TypeError("keepalive")}if(i.isDisturbed(t)||t.locked){throw new TypeError("Response body object should not be disturbed or locked")}o=t instanceof ReadableStream?t:a(t)}if(typeof d==="string"||i.isBuffer(d)){A=Buffer.byteLength(d)}if(l!=null){let r;o=new ReadableStream({async start(){r=l(t)[Symbol.asyncIterator]()},async pull(t){const{value:i,done:a}=await r.next();if(a){queueMicrotask((()=>{t.close();t.byobRequest?.respond(0)}))}else{if(!y(o)){const r=new Uint8Array(i);if(r.byteLength){t.enqueue(r)}}}return t.desiredSize>0},async cancel(t){await r.return()},type:"bytes"})}const h={stream:o,source:d,length:A};return[h,b]}function safelyExtractBody(t,r=false){if(t instanceof ReadableStream){O(!i.isDisturbed(t),"The body has already been consumed.");O(!t.locked,"The stream is locked.")}return extractBody(t,r)}function cloneBody(t,r){const[o,i]=r.stream.tee();r.stream=o;return{stream:i,length:r.length,source:r.source}}function throwIfAborted(t){if(t.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(t){const r={blob(){return consumeBody(this,(t=>{let r=bodyMimeType(this);if(r===null){r=""}else if(r){r=I(r)}return new z([t],{type:r})}),t)},arrayBuffer(){return consumeBody(this,(t=>new Uint8Array(t).buffer),t)},text(){return consumeBody(this,b,t)},json(){return consumeBody(this,parseJSONFromBytes,t)},formData(){return consumeBody(this,(t=>{const r=bodyMimeType(this);if(r!==null){switch(r.essence){case"multipart/form-data":{const o=R(t,r);if(o==="failure"){throw new TypeError("Failed to parse body as FormData.")}const i=new h;i[M]=o;return i}case"application/x-www-form-urlencoded":{const r=new URLSearchParams(t.toString());const o=new h;for(const[t,i]of r){o.append(t,i)}return o}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),t)},bytes(){return consumeBody(this,(t=>new Uint8Array(t)),t)}};return r}function mixinBody(t){Object.assign(t.prototype,bodyMixinMethods(t))}async function consumeBody(t,r,o){g.brandCheck(t,o);if(bodyUnusable(t)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(t[M]);const i=l();const errorSteps=t=>i.reject(t);const successSteps=t=>{try{i.resolve(r(t))}catch(t){errorSteps(t)}};if(t[M].body==null){successSteps(Buffer.allocUnsafe(0));return i.promise}await d(t[M].body,successSteps,errorSteps);return i.promise}function bodyUnusable(t){const r=t[M].body;return r!=null&&(r.stream.locked||i.isDisturbed(r.stream))}function parseJSONFromBytes(t){return JSON.parse(b(t))}function bodyMimeType(t){const r=t[M].headersList;const o=A(r);if(o==="failure"){return null}return o}t.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:N,hasFinalizationRegistry:w,bodyUnusable:bodyUnusable}},4495:t=>{const r=["GET","HEAD","POST"];const o=new Set(r);const i=[101,204,205,304];const a=[301,302,303,307,308];const c=new Set(a);const p=["1","7","9","11","13","15","17","19","20","21","22","23","25","37","42","43","53","69","77","79","87","95","101","102","103","104","109","110","111","113","115","117","119","123","135","137","139","143","161","179","389","427","465","512","513","514","515","526","530","531","532","540","548","554","556","563","587","601","636","989","990","993","995","1719","1720","1723","2049","3659","4045","4190","5060","5061","6000","6566","6665","6666","6667","6668","6669","6679","6697","10080"];const u=new Set(p);const l=["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"];const d=new Set(l);const A=["follow","manual","error"];const b=["GET","HEAD","OPTIONS","TRACE"];const h=new Set(b);const M=["navigate","same-origin","no-cors","cors"];const g=["omit","same-origin","include"];const z=["default","no-store","reload","no-cache","force-cLine truncated
|
||||
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */u[p-4]=o[0];u[p-3]=o[1];u[p-2]=o[2];u[p-1]=o[3];u[1]=c;if(c===126){u.writeUInt16BE(a,2)}else if(c===127){u[2]=u[3]=0;u.writeUIntBE(a,4,6)}u[1]|=128;for(let t=0;t<a;++t){u[p+t]=r[t]^o[t&3]}return u}}t.exports={WebsocketFrameSend:WebsocketFrameSend}},19469:(t,r,o)=>{const{createInflateRaw:i,Z_DEFAULT_WINDOWBITS:a}=o(38522);const{isValidClientWindowBits:c}=o(98625);const p=Buffer.from([0,0,255,255]);const u=Symbol("kBuffer");const l=Symbol("kLength");class PerMessageDeflate{#ce;#e={};constructor(t){this.#e.serverNoContextTakeover=t.has("server_no_context_takeover");this.#e.serverMaxWindowBits=t.get("server_max_window_bits")}decompress(t,r,o){if(!this.#ce){let t=a;if(this.#e.serverMaxWindowBits){if(!c(this.#e.serverMaxWindowBits)){o(new Error("Invalid server_max_window_bits"));return}t=Number.parseInt(this.#e.serverMaxWindowBits)}this.#ce=i({windowBits:t});this.#ce[u]=[];this.#ce[l]=0;this.#ce.on("data",(t=>{this.#ce[u].push(t);this.#ce[l]+=t.length}));this.#ce.on("error",(t=>{this.#ce=null;o(t)}))}this.#ce.write(t);if(r){this.#ce.write(p)}this.#ce.flush((()=>{const t=Buffer.concat(this.#ce[u],this.#ce[l]);this.#ce[u].length=0;this.#ce[l]=0;o(null,t)}))}}t.exports={PerMessageDeflate:PerMessageDeflate}},81652:(t,r,o)=>{const{Writable:i}=o(57075);const a=o(34589);const{parserStates:c,opcodes:p,states:u,emptyBuffer:l,sentCloseFrameState:d}=o(20736);const{kReadyState:A,kSentClose:b,kResponse:h,kReceivedClose:M}=o(61216);const{channels:g}=o(42414);const{isValidStatusCode:z,isValidOpcode:O,failWebsocketConnection:y,websocketMessageReceived:C,utf8Decode:B,isControlFrame:I,isTextBinaryFrame:R,isContinuationFrame:S}=o(98625);const{WebsocketFrameSend:q}=o(3264);const{closeWebSocketConnection:w}=o(86897);const{PerMessageDeflate:N}=o(19469);class ByteParser extends i{#pe=[];#ue=0;#le=false;#T=c.INFO;#de={};#Ae=[];#fe;constructor(t,r){super();this.ws=t;this.#fe=r==null?new Map:r;if(this.#fe.has("permessage-deflate")){this.#fe.set("permessage-deflate",new N(r))}}_write(t,r,o){this.#pe.push(t);this.#ue+=t.length;this.#le=true;this.run(o)}run(t){while(this.#le){if(this.#T===c.INFO){if(this.#ue<2){return t()}const r=this.consume(2);const o=(r[0]&128)!==0;const i=r[0]&15;const a=(r[1]&128)===128;const u=!o&&i!==p.CONTINUATION;const l=r[1]&127;const d=r[0]&64;const A=r[0]&32;const b=r[0]&16;if(!O(i)){y(this.ws,"Invalid opcode received");return t()}if(a){y(this.ws,"Frame cannot be masked");return t()}if(d!==0&&!this.#fe.has("permessage-deflate")){y(this.ws,"Expected RSV1 to be clear.");return}if(A!==0||b!==0){y(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(u&&!R(i)){y(this.ws,"Invalid frame type was fragmented.");return}if(R(i)&&this.#Ae.length>0){y(this.ws,"Expected continuation frame");return}if(this.#de.fragmented&&u){y(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((l>125||u)&&I(i)){y(this.ws,"Control frame either too large or fragmented");return}if(S(i)&&this.#Ae.length===0&&!this.#de.compressed){y(this.ws,"Unexpected continuation frame");return}if(l<=125){this.#de.payloadLength=l;this.#T=c.READ_DATA}else if(l===126){this.#T=c.PAYLOADLENGTH_16}else if(l===127){this.#T=c.PAYLOADLENGTH_64}if(R(i)){this.#de.binaryType=i;this.#de.compressed=d!==0}this.#de.opcode=i;this.#de.masked=a;this.#de.fin=o;this.#de.fragmented=u}else if(this.#T===c.PAYLOADLENGTH_16){if(this.#ue<2){return t()}const r=this.consume(2);this.#de.payloadLength=r.readUInt16BE(0);this.#T=c.READ_DATA}else if(this.#T===c.PAYLOADLENGTH_64){if(this.#ue<8){return t()}const r=this.consume(8);const o=r.readUInt32BE(0);if(o>2**31-1){y(this.ws,"Received payload length > 2^31 bytes.");return}const i=r.readUInt32BE(4);this.#de.payloadLength=(o<<8)+i;this.#T=c.READ_DATA}else if(this.#T===c.READ_DATA){if(this.#ue<this.#de.payloadLength){return t()}const r=this.consume(this.#de.payloadLength);if(I(this.#de.opcode)){this.#le=this.parseControlFrame(r);this.#T=c.INFO}else{if(!this.#de.compressed){this.#Ae.push(r);if(!this.#de.fragmented&&this.#de.fin){const t=Buffer.concat(this.#Ae);C(this.ws,this.#de.binaryType,t);this.#Ae.length=0}this.#T=c.INFO}else{this.#fe.get("permessage-deflate").decompress(r,this.#de.fin,((r,o)=>{if(r){w(this.ws,1007,r.message,r.message.length);return}this.#Ae.push(o);if(!this.#de.fin){this.#T=c.INFO;this.#le=true;this.run(t);return}C(this.ws,this.#de.binaryType,Buffer.concat(this.#Ae));this.#le=true;this.#T=c.INFO;this.#Ae.length=0;this.run(t)}));this.#le=false;break}}}}}consume(t){if(t>this.#ue){throw new Error("Called consume() before buffers satiated.")}else if(t===0){return l}if(this.#pe[0].length===t){this.#ue-=this.#pe[0].length;return this.#pe.shift()}const r=Buffer.allocUnsafe(t);let o=0;while(o!==t){const i=this.#pe[0];const{length:a}=i;if(a+o===t){r.set(this.#pe.shift(),o);break}else if(a+o>t){r.set(i.subarray(0,t-o),o);this.#pe[0]=i.subarray(t-o);break}else{r.set(this.#pe.shift(),o);o+=i.length}}this.#ue-=t;return r}parseCloseBody(t){a(t.length!==1);let r;if(t.lengtLine truncated
|
||||
/*!
|
||||
* XRegExp.build 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2012-present MIT License
|
||||
*/var u=function _default(p){var r="xregexp";var a=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g;var i=p.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,a],"g",{conjunction:"or"});function deanchor(p){var r=/^(?:\(\?:\))*\^/;var a=/\$(?:\(\?:\))*$/;if(r.test(p)&&a.test(p)&&a.test(p.replace(/\\[\s\S]/g,""))){return p.replace(r,"").replace(a,"")}return p}function asXRegExp(a,i){var d=i?"x":"";return p.isRegExp(a)?a[r]&&a[r].captureNames?a:p(a.source,d):p(a,d)}function interpolate(r){return r instanceof RegExp?r:p.escape(r)}function reduceToSubpatternsObject(p,r,a){p["subpattern".concat(a)]=r;return p}function embedSubpatternAfter(p,r,a){var i=r<a.length-1;return p+(i?"{{subpattern".concat(r,"}}"):"")}p.tag=function(r){return function(a){var i,d;for(var c=arguments.length,b=new Array(c>1?c-1:0),u=1;u<c;u++){b[u-1]=arguments[u]}var O=(0,z["default"])(i=(0,M["default"])(b).call(b,interpolate)).call(i,reduceToSubpatternsObject,{});var l=(0,M["default"])(d=a.raw).call(d,embedSubpatternAfter).join("");return p.build(l,O,r)}};p.build=function(d,M,z){z=z||"";var u=(0,b["default"])(z).call(z,"x");var O=/^\(\?([\w$]+)\)/.exec(d);if(O){z=p._clipDuplicates(z+O[1])}var l={};for(var A in M){if(M.hasOwnProperty(A)){var m=asXRegExp(M[A],u);l[A]={pattern:deanchor(m.source),names:m[r].captureNames||[]}}}var q=asXRegExp(d,u);var h=0;var W;var g=0;var v=[0];var R=q[r].captureNames||[];var _=q.source.replace(i,(function(p,r,i,d,b){var M=r||i;var z;var u;var O;if(M){var A;if(!l.hasOwnProperty(M)){throw new ReferenceError("Undefined property ".concat(p))}if(r){z=R[g];v[++g]=++h;u="(?<".concat(z||M,">")}else{u="(?:"}W=h;var m=l[M].pattern.replace(a,(function(p,r,a){if(r){z=l[M].names[h-W];++h;if(z){return"(?<".concat(z,">")}}else if(a){O=+a-1;return l[M].names[O]?"\\k<".concat(l[M].names[O],">"):"\\".concat(+a+W)}return p}));return(0,c["default"])(A="".concat(u)).call(A,m,")")}if(d){z=R[g];v[++g]=++h;if(z){return"(?<".concat(z,">")}}else if(b){O=+b-1;return R[O]?"\\k<".concat(R[O],">"):"\\".concat(v[+b])}return p}));return p(_,z)}};r["default"]=u;p.exports=r.default},4811:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(9188));var b=i(a(466));var M=i(a(6611));
|
||||
*/var d=function _default(t){var r="xregexp";var o=/(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*\]/g;var i=t.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/,o],"g",{conjunction:"or"});function deanchor(t){var r=/^(?:\(\?:\))*\^/;var o=/\$(?:\(\?:\))*$/;if(r.test(t)&&o.test(t)&&o.test(t.replace(/\\[\s\S]/g,""))){return t.replace(r,"").replace(o,"")}return t}function asXRegExp(o,i){var a=i?"x":"";return t.isRegExp(o)?o[r]&&o[r].captureNames?o:t(o.source,a):t(o,a)}function interpolate(r){return r instanceof RegExp?r:t.escape(r)}function reduceToSubpatternsObject(t,r,o){t["subpattern".concat(o)]=r;return t}function embedSubpatternAfter(t,r,o){var i=r<o.length-1;return t+(i?"{{subpattern".concat(r,"}}"):"")}t.tag=function(r){return function(o){var i,a;for(var c=arguments.length,p=new Array(c>1?c-1:0),d=1;d<c;d++){p[d-1]=arguments[d]}var A=(0,l["default"])(i=(0,u["default"])(p).call(p,interpolate)).call(i,reduceToSubpatternsObject,{});var b=(0,u["default"])(a=o.raw).call(a,embedSubpatternAfter).join("");return t.build(b,A,r)}};t.build=function(a,u,l){l=l||"";var d=(0,p["default"])(l).call(l,"x");var A=/^\(\?([\w$]+)\)/.exec(a);if(A){l=t._clipDuplicates(l+A[1])}var b={};for(var h in u){if(u.hasOwnProperty(h)){var M=asXRegExp(u[h],d);b[h]={pattern:deanchor(M.source),names:M[r].captureNames||[]}}}var g=asXRegExp(a,d);var z=0;var O;var y=0;var C=[0];var B=g[r].captureNames||[];var I=g.source.replace(i,(function(t,r,i,a,p){var u=r||i;var l;var d;var A;if(u){var h;if(!b.hasOwnProperty(u)){throw new ReferenceError("Undefined property ".concat(t))}if(r){l=B[y];C[++y]=++z;d="(?<".concat(l||u,">")}else{d="(?:"}O=z;var M=b[u].pattern.replace(o,(function(t,r,o){if(r){l=b[u].names[z-O];++z;if(l){return"(?<".concat(l,">")}}else if(o){A=+o-1;return b[u].names[A]?"\\k<".concat(b[u].names[A],">"):"\\".concat(+o+O)}return t}));return(0,c["default"])(h="".concat(d)).call(h,M,")")}if(a){l=B[y];C[++y]=++z;if(l){return"(?<".concat(l,">")}}else if(p){A=+p-1;return B[A]?"\\k<".concat(B[A],">"):"\\".concat(C[+p])}return t}));return t(I,l)}};r["default"]=d;t.exports=r.default},53938:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(17012));var p=i(o(45492));var u=i(o(73157));
|
||||
/*!
|
||||
* XRegExp.matchRecursive 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2009-present MIT License
|
||||
*/var z=function _default(p){function row(p,r,a,i){return{name:p,value:r,start:a,end:i}}p.matchRecursive=function(r,a,i,d,z){d=d||"";z=z||{};var u=(0,M["default"])(d).call(d,"g");var O=(0,M["default"])(d).call(d,"y");var l=d.replace(/y/g,"");var A=z,m=A.escapeChar;var q=z.valueNames;var h=[];var W=0;var g=0;var v=0;var R=0;var _;var L;var w;var E;var T;a=p(a,l);i=p(i,l);if(m){var N,y;if(m.length>1){throw new Error("Cannot use more than one escape character")}m=p.escape(m);T=new RegExp((0,b["default"])(N=(0,b["default"])(y="(?:".concat(m,"[\\S\\s]|(?:(?!")).call(y,p.union([a,i],"",{conjunction:"or"}).source,")[^")).call(N,m,"])+)+"),d.replace(/[^imu]+/g,""))}while(true){if(m){v+=(p.exec(r,T,v,"sticky")||[""])[0].length}w=p.exec(r,a,v);E=p.exec(r,i,v);if(w&&E){if(w.index<=E.index){E=null}else{w=null}}if(w||E){g=(w||E).index;v=g+(w||E)[0].length}else if(!W){break}if(O&&!W&&g>R){break}if(w){if(!W){_=g;L=v}++W}else if(E&&W){if(!--W){if(q){if(q[0]&&_>R){h.push(row(q[0],(0,c["default"])(r).call(r,R,_),R,_))}if(q[1]){h.push(row(q[1],(0,c["default"])(r).call(r,_,L),_,L))}if(q[2]){h.push(row(q[2],(0,c["default"])(r).call(r,L,g),L,g))}if(q[3]){h.push(row(q[3],(0,c["default"])(r).call(r,g,v),g,v))}}else{h.push((0,c["default"])(r).call(r,L,g))}R=v;if(!u){break}}}else{throw new Error("Unbalanced delimiter found in string")}if(g===v){++v}}if(u&&!O&&q&&q[0]&&r.length>R){h.push(row(q[0],(0,c["default"])(r).call(r,R),R,r.length))}return h}};r["default"]=z;p.exports=r.default},3110:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(2038));var b=i(a(5401));var M=i(a(9640));var z=i(a(7652));var u=i(a(3361));var O=i(a(9188));var l=i(a(6611));var A=i(a(466));var m=i(a(669));function _createForOfIteratorHelper(p,r){var a;if(typeof z["default"]==="undefined"||(0,M["default"])(p)==null){if((0,b["default"])(p)||(a=_unsupportedIterableToArray(p))||r&&p&&typeof p.length==="number"){if(a)p=a;var i=0;var d=function F(){};return{s:d,n:function n(){if(i>=p.length)return{done:true};return{done:false,value:p[i++]}},e:function e(p){throw p},f:d}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,O=false,l;return{s:function s(){a=(0,c["default"])(p)},n:function n(){var p=a.next();u=p.done;return p},e:function e(p){O=true;l=p},f:function f(){try{if(!u&&a["return"]!=null)a["return"]()}finally{if(O)throw l}}}}function _unsupportedIterableToArray(p,r){var a;if(!p)return;if(typeof p==="string")return _arrayLikeToArray(p,r);var i=(0,O["default"])(a=Object.prototype.toString.call(p)).call(a,8,-1);if(i==="Object"&&p.constructor)i=p.constructor.name;if(i==="Map"||i==="Set")return(0,u["default"])(p);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(p,r)}function _arrayLikeToArray(p,r){if(r==null||r>p.length)r=p.length;for(var a=0,i=new Array(r);a<r;a++){i[a]=p[a]}return i}
|
||||
*/var l=function _default(t){function row(t,r,o,i){return{name:t,value:r,start:o,end:i}}t.matchRecursive=function(r,o,i,a,l){a=a||"";l=l||{};var d=(0,u["default"])(a).call(a,"g");var A=(0,u["default"])(a).call(a,"y");var b=a.replace(/y/g,"");var h=l,M=h.escapeChar;var g=l.valueNames;var z=[];var O=0;var y=0;var C=0;var B=0;var I;var R;var S;var q;var w;o=t(o,b);i=t(i,b);if(M){var N,v;if(M.length>1){throw new Error("Cannot use more than one escape character")}M=t.escape(M);w=new RegExp((0,p["default"])(N=(0,p["default"])(v="(?:".concat(M,"[\\S\\s]|(?:(?!")).call(v,t.union([o,i],"",{conjunction:"or"}).source,")[^")).call(N,M,"])+)+"),a.replace(/[^imu]+/g,""))}while(true){if(M){C+=(t.exec(r,w,C,"sticky")||[""])[0].length}S=t.exec(r,o,C);q=t.exec(r,i,C);if(S&&q){if(S.index<=q.index){q=null}else{S=null}}if(S||q){y=(S||q).index;C=y+(S||q)[0].length}else if(!O){break}if(A&&!O&&y>B){break}if(S){if(!O){I=y;R=C}++O}else if(q&&O){if(! --O){if(g){if(g[0]&&I>B){z.push(row(g[0],(0,c["default"])(r).call(r,B,I),B,I))}if(g[1]){z.push(row(g[1],(0,c["default"])(r).call(r,I,R),I,R))}if(g[2]){z.push(row(g[2],(0,c["default"])(r).call(r,R,y),R,y))}if(g[3]){z.push(row(g[3],(0,c["default"])(r).call(r,y,C),y,C))}}else{z.push((0,c["default"])(r).call(r,R,y))}B=C;if(!d){break}}}else{throw new Error("Unbalanced delimiter found in string")}if(y===C){++C}}if(d&&!A&&g&&g[0]&&r.length>B){z.push(row(g[0],(0,c["default"])(r).call(r,B),B,r.length))}return z}};r["default"]=l;t.exports=r.default},24594:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(28187));var p=i(o(28708));var u=i(o(79285));var l=i(o(81098));var d=i(o(66300));var A=i(o(17012));var b=i(o(73157));var h=i(o(45492));var M=i(o(60167));function _createForOfIteratorHelper(t,r){var o;if(typeof l["default"]==="undefined"||(0,u["default"])(t)==null){if((0,p["default"])(t)||(o=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(o)t=o;var i=0;var a=function F(){};return{s:a,n:function n(){if(i>=t.length)return{done:true};return{done:false,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d=true,A=false,b;return{s:function s(){o=(0,c["default"])(t)},n:function n(){var t=o.next();d=t.done;return t},e:function e(t){A=true;b=t},f:function f(){try{if(!d&&o["return"]!=null)o["return"]()}finally{if(A)throw b}}}}function _unsupportedIterableToArray(t,r){var o;if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=(0,A["default"])(o=Object.prototype.toString.call(t)).call(o,8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return(0,d["default"])(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var o=0,i=new Array(r);o<r;o++){i[o]=t[o]}return i}
|
||||
/*!
|
||||
* XRegExp Unicode Base 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2008-present MIT License
|
||||
*/var q=function _default(p){var r={};var a=p._dec;var i=p._hex;var d=p._pad4;function normalize(p){return p.replace(/[- _]+/g,"").toLowerCase()}function charCode(p){var r=/^\\[xu](.+)/.exec(p);return r?a(r[1]):p.charCodeAt(p[0]==="\\"?1:0)}function invertBmp(r){var a="";var c=-1;(0,m["default"])(p).call(p,r,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,(function(p){var r=charCode(p[1]);if(r>c+1){a+="\\u".concat(d(i(c+1)));if(r>c+2){a+="-\\u".concat(d(i(r-1)))}}c=charCode(p[2]||p[1])}));if(c<65535){a+="\\u".concat(d(i(c+1)));if(c<65534){a+="-\\uFFFF"}}return a}function cacheInvertedBmp(p){var a="b!";return r[p][a]||(r[p][a]=invertBmp(r[p].bmp))}function buildAstral(p,a){var i=r[p];var d="";if(i.bmp&&!i.isBmpLast){var c;d=(0,A["default"])(c="[".concat(i.bmp,"]")).call(c,i.astral?"|":"")}if(i.astral){d+=i.astral}if(i.isBmpLast&&i.bmp){var b;d+=(0,A["default"])(b="".concat(i.astral?"|":"","[")).call(b,i.bmp,"]")}return a?"(?:(?!".concat(d,")(?:[\ud800-\udbff][\udc00-\udfff]|[\0-]))"):"(?:".concat(d,")")}function cacheAstral(p,a){var i=a?"a!":"a=";return r[p][i]||(r[p][i]=buildAstral(p,a))}p.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,(function(p,a,i){var d="Invalid double negation ";var c="Unknown Unicode token ";var b="Unicode token missing data ";var M="Astral mode required for Unicode token ";var z="Astral mode does not support Unicode tokens within character classes";var u=p[1]==="P"||!!p[2];var O=(0,l["default"])(i).call(i,"A");var m=normalize(p[4]||p[3]);var q=r[m];if(p[1]==="P"&&p[2]){throw new SyntaxError(d+p[0])}if(!r.hasOwnProperty(m)){throw new SyntaxError(c+p[0])}if(q.inverseOf){m=normalize(q.inverseOf);if(!r.hasOwnProperty(m)){var h;throw new ReferenceError((0,A["default"])(h="".concat(b+p[0]," -> ")).call(h,q.inverseOf))}q=r[m];u=!u}if(!(q.bmp||O)){throw new SyntaxError(M+p[0])}if(O){if(a==="class"){throw new SyntaxError(z)}return cacheAstral(m,u)}return a==="class"?u?cacheInvertedBmp(m):q.bmp:"".concat((u?"[^":"[")+q.bmp,"]")}),{scope:"all",optionalFlags:"A",leadChar:"\\"});p.addUnicodeData=function(a){var i="Unicode token requires name";var d="Unicode token has no character data ";var c=_createForOfIteratorHelper(a),b;try{for(c.s();!(b=c.n()).done;){var M=b.value;if(!M.name){throw new Error(i)}if(!(M.inverseOf||M.bmp||M.astral)){throw new Error(d+M.name)}r[normalize(M.name)]=M;if(M.alias){r[normalize(M.alias)]=M}}}catch(p){c.e(p)}finally{c.f()}p.cache.flush("patterns")};p._getUnicodeProperty=function(p){var a=normalize(p);return r[a]}};r["default"]=q;p.exports=r.default},4686:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(5826));
|
||||
*/var g=function _default(t){var r={};var o=t._dec;var i=t._hex;var a=t._pad4;function normalize(t){return t.replace(/[- _]+/g,"").toLowerCase()}function charCode(t){var r=/^\\[xu](.+)/.exec(t);return r?o(r[1]):t.charCodeAt(t[0]==="\\"?1:0)}function invertBmp(r){var o="";var c=-1;(0,M["default"])(t).call(t,r,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,(function(t){var r=charCode(t[1]);if(r>c+1){o+="\\u".concat(a(i(c+1)));if(r>c+2){o+="-\\u".concat(a(i(r-1)))}}c=charCode(t[2]||t[1])}));if(c<65535){o+="\\u".concat(a(i(c+1)));if(c<65534){o+="-\\uFFFF"}}return o}function cacheInvertedBmp(t){var o="b!";return r[t][o]||(r[t][o]=invertBmp(r[t].bmp))}function buildAstral(t,o){var i=r[t];var a="";if(i.bmp&&!i.isBmpLast){var c;a=(0,h["default"])(c="[".concat(i.bmp,"]")).call(c,i.astral?"|":"")}if(i.astral){a+=i.astral}if(i.isBmpLast&&i.bmp){var p;a+=(0,h["default"])(p="".concat(i.astral?"|":"","[")).call(p,i.bmp,"]")}return o?"(?:(?!".concat(a,")(?:[\ud800-\udbff][\udc00-\udfff]|[\0-]))"):"(?:".concat(a,")")}function cacheAstral(t,o){var i=o?"a!":"a=";return r[t][i]||(r[t][i]=buildAstral(t,o))}t.addToken(/\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/,(function(t,o,i){var a="Invalid double negation ";var c="Unknown Unicode token ";var p="Unicode token missing data ";var u="Astral mode required for Unicode token ";var l="Astral mode does not support Unicode tokens within character classes";var d=t[1]==="P"||!!t[2];var A=(0,b["default"])(i).call(i,"A");var M=normalize(t[4]||t[3]);var g=r[M];if(t[1]==="P"&&t[2]){throw new SyntaxError(a+t[0])}if(!r.hasOwnProperty(M)){throw new SyntaxError(c+t[0])}if(g.inverseOf){M=normalize(g.inverseOf);if(!r.hasOwnProperty(M)){var z;throw new ReferenceError((0,h["default"])(z="".concat(p+t[0]," -> ")).call(z,g.inverseOf))}g=r[M];d=!d}if(!(g.bmp||A)){throw new SyntaxError(u+t[0])}if(A){if(o==="class"){throw new SyntaxError(l)}return cacheAstral(M,d)}return o==="class"?d?cacheInvertedBmp(M):g.bmp:"".concat((d?"[^":"[")+g.bmp,"]")}),{scope:"all",optionalFlags:"A",leadChar:"\\"});t.addUnicodeData=function(o){var i="Unicode token requires name";var a="Unicode token has no character data ";var c=_createForOfIteratorHelper(o),p;try{for(c.s();!(p=c.n()).done;){var u=p.value;if(!u.name){throw new Error(i)}if(!(u.inverseOf||u.bmp||u.astral)){throw new Error(a+u.name)}r[normalize(u.name)]=u;if(u.alias){r[normalize(u.alias)]=u}}}catch(t){c.e(t)}finally{c.f()}t.cache.flush("patterns")};t._getUnicodeProperty=function(t){var o=normalize(t);return r[o]}};r["default"]=g;t.exports=r.default},65853:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(38657));
|
||||
/*!
|
||||
* XRegExp Unicode Blocks 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2010-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/var b=function _default(p){if(!p.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Blocks")}p.addUnicodeData(c["default"])};r["default"]=b;p.exports=r.default},1996:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(8537));
|
||||
*/var p=function _default(t){if(!t.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Blocks")}t.addUnicodeData(c["default"])};r["default"]=p;t.exports=r.default},87167:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(4219));
|
||||
/*!
|
||||
* XRegExp Unicode Categories 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2010-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/var b=function _default(p){if(!p.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Categories")}p.addUnicodeData(c["default"])};r["default"]=b;p.exports=r.default},9250:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(616));
|
||||
*/var p=function _default(t){if(!t.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Categories")}t.addUnicodeData(c["default"])};r["default"]=p;t.exports=r.default},53682:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(73862));
|
||||
/*!
|
||||
* XRegExp Unicode Properties 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2012-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/var b=function _default(p){if(!p.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Properties")}var r=c["default"];r.push({name:"Assigned",inverseOf:"Cn"});p.addUnicodeData(r)};r["default"]=b;p.exports=r.default},5715:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(2524));
|
||||
*/var p=function _default(t){if(!t.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Properties")}var r=c["default"];r.push({name:"Assigned",inverseOf:"Cn"});t.addUnicodeData(r)};r["default"]=p;t.exports=r.default},57387:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(77103));
|
||||
/*!
|
||||
* XRegExp Unicode Scripts 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2010-present MIT License
|
||||
* Unicode data by Mathias Bynens <mathiasbynens.be>
|
||||
*/var b=function _default(p){if(!p.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts")}p.addUnicodeData(c["default"])};r["default"]=b;p.exports=r.default},7750:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(8612));var b=i(a(380));var M=i(a(4811));var z=i(a(3110));var u=i(a(4686));var O=i(a(1996));var l=i(a(9250));var A=i(a(5715));(0,b["default"])(c["default"]);(0,M["default"])(c["default"]);(0,z["default"])(c["default"]);(0,u["default"])(c["default"]);(0,O["default"])(c["default"]);(0,l["default"])(c["default"]);(0,A["default"])(c["default"]);var m=c["default"];r["default"]=m;p.exports=r.default},8612:(p,r,a)=>{"use strict";var i=a(515);var d=a(4218);d(r,"__esModule",{value:true});r["default"]=void 0;var c=i(a(2038));var b=i(a(5401));var M=i(a(9640));var z=i(a(7652));var u=i(a(3361));var O=i(a(466));var l=i(a(3781));var A=i(a(6761));var m=i(a(8135));var q=i(a(669));var h=i(a(6611));var W=i(a(1308));var g=i(a(9188));var v=i(a(8979));var R=i(a(3046));function _createForOfIteratorHelper(p,r){var a;if(typeof z["default"]==="undefined"||(0,M["default"])(p)==null){if((0,b["default"])(p)||(a=_unsupportedIterableToArray(p))||r&&p&&typeof p.length==="number"){if(a)p=a;var i=0;var d=function F(){};return{s:d,n:function n(){if(i>=p.length)return{done:true};return{done:false,value:p[i++]}},e:function e(p){throw p},f:d}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,O=false,l;return{s:function s(){a=(0,c["default"])(p)},n:function n(){var p=a.next();u=p.done;return p},e:function e(p){O=true;l=p},f:function f(){try{if(!u&&a["return"]!=null)a["return"]()}finally{if(O)throw l}}}}function _unsupportedIterableToArray(p,r){var a;if(!p)return;if(typeof p==="string")return _arrayLikeToArray(p,r);var i=(0,g["default"])(a=Object.prototype.toString.call(p)).call(a,8,-1);if(i==="Object"&&p.constructor)i=p.constructor.name;if(i==="Map"||i==="Set")return(0,u["default"])(p);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(p,r)}function _arrayLikeToArray(p,r){if(r==null||r>p.length)r=p.length;for(var a=0,i=new Array(r);a<r;a++){i[a]=p[a]}return i}
|
||||
*/var p=function _default(t){if(!t.addUnicodeData){throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts")}t.addUnicodeData(c["default"])};r["default"]=p;t.exports=r.default},63897:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(1240));var p=i(o(11577));var u=i(o(53938));var l=i(o(24594));var d=i(o(65853));var A=i(o(87167));var b=i(o(53682));var h=i(o(57387));(0,p["default"])(c["default"]);(0,u["default"])(c["default"]);(0,l["default"])(c["default"]);(0,d["default"])(c["default"]);(0,A["default"])(c["default"]);(0,b["default"])(c["default"]);(0,h["default"])(c["default"]);var M=c["default"];r["default"]=M;t.exports=r.default},1240:(t,r,o)=>{var i=o(91901);var a=o(96141);a(r,"__esModule",{value:true});r["default"]=void 0;var c=i(o(28187));var p=i(o(28708));var u=i(o(79285));var l=i(o(81098));var d=i(o(66300));var A=i(o(45492));var b=i(o(70738));var h=i(o(89756));var M=i(o(77768));var g=i(o(60167));var z=i(o(73157));var O=i(o(76115));var y=i(o(17012));var C=i(o(77764));var B=i(o(89505));function _createForOfIteratorHelper(t,r){var o;if(typeof l["default"]==="undefined"||(0,u["default"])(t)==null){if((0,p["default"])(t)||(o=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(o)t=o;var i=0;var a=function F(){};return{s:a,n:function n(){if(i>=t.length)return{done:true};return{done:false,value:t[i++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var d=true,A=false,b;return{s:function s(){o=(0,c["default"])(t)},n:function n(){var t=o.next();d=t.done;return t},e:function e(t){A=true;b=t},f:function f(){try{if(!d&&o["return"]!=null)o["return"]()}finally{if(A)throw b}}}}function _unsupportedIterableToArray(t,r){var o;if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=(0,y["default"])(o=Object.prototype.toString.call(t)).call(o,8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return(0,d["default"])(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var o=0,i=new Array(r);o<r;o++){i[o]=t[o]}return i}
|
||||
/*!
|
||||
* XRegExp 4.4.1
|
||||
* <xregexp.com>
|
||||
* Steven Levithan (c) 2007-present MIT License
|
||||
*/var _="xregexp";var L={astral:false,namespacing:false};var w={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split};var E={};var T={};var N={};var y=[];var S="default";var B="class";var k={default:/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,class:/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/};var P=/\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g;var X=w.exec.call(/()??/,"")[1]===undefined;var C=(0,R["default"])(/x/)!==undefined;var D={},x=D.toString;function hasNativeFlag(p){var r=true;try{new RegExp("",p);if(p==="y"){var a=function(){return"gy"}();var i=".a".replace(new RegExp("a",a),".")==="..";if(i){r=false}}}catch(p){r=false}return r}var I=hasNativeFlag("u");var G=hasNativeFlag("y");var U={g:true,i:true,m:true,u:I,y:G};function augment(p,r,a,i,d){var c;p[_]={captureNames:r};if(d){return p}if(p.__proto__){p.__proto__=XRegExp.prototype}else{for(var b in XRegExp.prototype){p[b]=XRegExp.prototype[b]}}p[_].source=a;p[_].flags=i?(0,v["default"])(c=i.split("")).call(c).join(""):i;return p}function clipDuplicates(p){return w.replace.call(p,/([\s\S])(?=[\s\S]*\1)/g,"")}function copyRegex(p,r){var a;if(!XRegExp.isRegExp(p)){throw new TypeError("Type RegExp expected")}var i=p[_]||{};var d=getNativeFlags(p);var c="";var b="";var M=null;var z=null;r=r||{};if(r.removeG){b+="g"}if(r.removeY){b+="y"}if(b){d=w.replace.call(d,new RegExp("[".concat(b,"]+"),"g"),"")}if(r.addG){c+="g"}if(r.addY){c+="y"}if(c){d=clipDuplicates(d+c)}if(!r.isInternalOnly){if(i.source!==undefined){M=i.source}if((0,R["default"])(i)!=null){z=c?clipDuplicates((0,R["default"])(i)+c):(0,R["default"])(i)}}p=augment(new RegExp(r.source||p.source,d),hasNamedCapture(p)?(0,g["default"])(a=i.captureNames).call(a,0):null,M,z,r.isInternalOnly);return p}function dec(p){return(0,W["default"])(p,16)}function getContextualTokenSeparator(p,r,a){if(p.input[p.index-1]==="("||p.input[p.index+p[0].length]===")"||p.input[p.index-1]==="|"||p.input[p.index+p[0].length]==="|"||p.index<1||p.index+p[0].length>=p.input.length||w.test.call(/^\(\?[:=!]/,p.input.substr(p.index-3,3))||isQuantifierNext(p.input,p.index+p[0].length,a)){return""}return"(?:)"}function getNativeFlags(p){return C?(0,R["default"])(p):w.exec.call(/\/([a-z]*)$/i,RegExp.prototype.toString.call(p))[1]}function hasNamedCapture(p){return!!(p[_]&&p[_].captureNames)}function hex(p){return(0,W["default"])(p,10).toString(16)}function isQuantifierNext(p,r,a){var i="\\(\\?#[^)]*\\)";var d="#[^#\\n]*";var c="[?*+]|{\\d+(?:,\\d*)?}";return w.test.call((0,h["default"])(a).call(a,"x")?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,(0,g["default"])(p).call(p,r))}function isType(p,r){return x.call(p)==="[object ".concat(r,"]")}function pad4(p){while(p.length<4){p="0".concat(p)}return p}function prepareFlags(p,r){if(clipDuplicates(r)!==r){throw new SyntaxError("Invalid duplicate regex flag ".concat(r))}p=w.replace.call(p,/^\(\?([\w$]+)\)/,(function(p,a){if(w.test.call(/[gy]/,a)){throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat(p))}r=clipDuplicates(r+a);return""}));var a=_createForOfIteratorHelper(r),i;try{for(a.s();!(i=a.n()).done;){var d=i.value;if(!U[d]){throw new SyntaxError("Unknown regex flag ".concat(d))}}}catch(p){a.e(p)}finally{a.f()}return{pattern:p,flags:r}}function prepareOptions(p){var r={};if(isType(p,"String")){(0,q["default"])(XRegExp).call(XRegExp,p,/[^\s,]+/,(function(p){r[p]=true}));return r}return p}function registerFlag(p){if(!/^[\w$]$/.test(p)){throw new Error("Flag must be a single character A-Za-z0-9_$")}U[p]=true}function runTokens(p,r,a,i,d){var c=y.length;var b=p[a];var M=null;var z;var u;while(c--){u=y[c];if(u.leadChar&&u.leadChar!==b||u.scope!==i&&u.scope!=="all"||u.flag&&!(0,h["default"])(r).call(r,u.flag)){continue}z=XRegExp.exec(p,u.regex,a,"sticky");if(z){M={matchLength:z[0].length,output:u.handler.call(d,z,i,r),reparse:u.reparse};break}}return M}function setAstral(p){L.astral=p}function setNamespacing(p){L.namespacing=p}function toObject(p){if(p==null){throw new TypeError("Cannot convert null or undefined to object")}return p}function XRegExp(p,r){if(XRegExp.isRegExp(p)){if(r!==undefined){throw new TypeError("Cannot supply flags when copying a RegExp")}return copyRegex(p)}p=p===undefined?"":String(p);r=r===undefined?"":String(r);if(XRegExp.isInstalled("astral")&&!(0,h["default"])(r).call(r,"A")){r+="A"}if(!N[p]){N[p]={}}if(!N[p][r]){var a={hasNamedCapture:false,captureNames:[]};var i=S;var d="";var c=0;var b;var M=prepareFlags(p,r);var z=M.pattern;var u=(0,R["default"])(M);while(c<z.length){do{b=runTokens(z,u,c,i,a);if(b&&b.reparse){z=(0,g["default"])(z).call(z,0,c)+b.output+(0,g["default"])(z).call(z,c+b.matchLength)}}while(b&&b.reparsLine truncated
|
||||
*/var I="xregexp";var R={astral:false,namespacing:false};var S={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split};var q={};var w={};var N={};var v=[];var T="default";var W="class";var L={default:/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,class:/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/};var _=/\$(?:{([\w$]+)}|<([\w$]+)>|(\d\d?|[\s\S]))/g;var x=S.exec.call(/()??/,"")[1]===undefined;var k=(0,B["default"])(/x/)!==undefined;var Q={},D=Q.toString;function hasNativeFlag(t){var r=true;try{new RegExp("",t);if(t==="y"){var o=function(){return"gy"}();var i=".a".replace(new RegExp("a",o),".")==="..";if(i){r=false}}}catch(t){r=false}return r}var P=hasNativeFlag("u");var U=hasNativeFlag("y");var H={g:true,i:true,m:true,u:P,y:U};function augment(t,r,o,i,a){var c;t[I]={captureNames:r};if(a){return t}if(t.__proto__){t.__proto__=XRegExp.prototype}else{for(var p in XRegExp.prototype){t[p]=XRegExp.prototype[p]}}t[I].source=o;t[I].flags=i?(0,C["default"])(c=i.split("")).call(c).join(""):i;return t}function clipDuplicates(t){return S.replace.call(t,/([\s\S])(?=[\s\S]*\1)/g,"")}function copyRegex(t,r){var o;if(!XRegExp.isRegExp(t)){throw new TypeError("Type RegExp expected")}var i=t[I]||{};var a=getNativeFlags(t);var c="";var p="";var u=null;var l=null;r=r||{};if(r.removeG){p+="g"}if(r.removeY){p+="y"}if(p){a=S.replace.call(a,new RegExp("[".concat(p,"]+"),"g"),"")}if(r.addG){c+="g"}if(r.addY){c+="y"}if(c){a=clipDuplicates(a+c)}if(!r.isInternalOnly){if(i.source!==undefined){u=i.source}if((0,B["default"])(i)!=null){l=c?clipDuplicates((0,B["default"])(i)+c):(0,B["default"])(i)}}t=augment(new RegExp(r.source||t.source,a),hasNamedCapture(t)?(0,y["default"])(o=i.captureNames).call(o,0):null,u,l,r.isInternalOnly);return t}function dec(t){return(0,O["default"])(t,16)}function getContextualTokenSeparator(t,r,o){if(t.input[t.index-1]==="("||t.input[t.index+t[0].length]===")"||t.input[t.index-1]==="|"||t.input[t.index+t[0].length]==="|"||t.index<1||t.index+t[0].length>=t.input.length||S.test.call(/^\(\?[:=!]/,t.input.substr(t.index-3,3))||isQuantifierNext(t.input,t.index+t[0].length,o)){return""}return"(?:)"}function getNativeFlags(t){return k?(0,B["default"])(t):S.exec.call(/\/([a-z]*)$/i,RegExp.prototype.toString.call(t))[1]}function hasNamedCapture(t){return!!(t[I]&&t[I].captureNames)}function hex(t){return(0,O["default"])(t,10).toString(16)}function isQuantifierNext(t,r,o){var i="\\(\\?#[^)]*\\)";var a="#[^#\\n]*";var c="[?*+]|{\\d+(?:,\\d*)?}";return S.test.call((0,z["default"])(o).call(o,"x")?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,(0,y["default"])(t).call(t,r))}function isType(t,r){return D.call(t)==="[object ".concat(r,"]")}function pad4(t){while(t.length<4){t="0".concat(t)}return t}function prepareFlags(t,r){if(clipDuplicates(r)!==r){throw new SyntaxError("Invalid duplicate regex flag ".concat(r))}t=S.replace.call(t,/^\(\?([\w$]+)\)/,(function(t,o){if(S.test.call(/[gy]/,o)){throw new SyntaxError("Cannot use flag g or y in mode modifier ".concat(t))}r=clipDuplicates(r+o);return""}));var o=_createForOfIteratorHelper(r),i;try{for(o.s();!(i=o.n()).done;){var a=i.value;if(!H[a]){throw new SyntaxError("Unknown regex flag ".concat(a))}}}catch(t){o.e(t)}finally{o.f()}return{pattern:t,flags:r}}function prepareOptions(t){var r={};if(isType(t,"String")){(0,g["default"])(XRegExp).call(XRegExp,t,/[^\s,]+/,(function(t){r[t]=true}));return r}return t}function registerFlag(t){if(!/^[\w$]$/.test(t)){throw new Error("Flag must be a single character A-Za-z0-9_$")}H[t]=true}function runTokens(t,r,o,i,a){var c=v.length;var p=t[o];var u=null;var l;var d;while(c--){d=v[c];if(d.leadChar&&d.leadChar!==p||d.scope!==i&&d.scope!=="all"||d.flag&&!(0,z["default"])(r).call(r,d.flag)){continue}l=XRegExp.exec(t,d.regex,o,"sticky");if(l){u={matchLength:l[0].length,output:d.handler.call(a,l,i,r),reparse:d.reparse};break}}return u}function setAstral(t){R.astral=t}function setNamespacing(t){R.namespacing=t}function toObject(t){if(t==null){throw new TypeError("Cannot convert null or undefined to object")}return t}function XRegExp(t,r){if(XRegExp.isRegExp(t)){if(r!==undefined){throw new TypeError("Cannot supply flags when copying a RegExp")}return copyRegex(t)}t=t===undefined?"":String(t);r=r===undefined?"":String(r);if(XRegExp.isInstalled("astral")&&!(0,z["default"])(r).call(r,"A")){r+="A"}if(!N[t]){N[t]={}}if(!N[t][r]){var o={hasNamedCapture:false,captureNames:[]};var i=T;var a="";var c=0;var p;var u=prepareFlags(t,r);var l=u.pattern;var d=(0,B["default"])(u);while(c<l.length){do{p=runTokens(l,d,c,i,o);if(p&&p.reparse){l=(0,y["default"])(l).call(l,0,c)+p.output+(0,y["default"])(l).call(l,c+p.matchLength)}}while(p&&p.reparsLine truncated
|
||||
/* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist */if("response"in o){this.response=o.response}const i=Object.assign({},o.request);if(o.request.headers.authorization){i.headers=Object.assign({},o.request.headers,{authorization:o.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})}i.url=i.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]");this.request=i}}var bf="10.0.8";var hf={headers:{"user-agent":`octokit-request.js/${bf} ${getUserAgent()}`}};function dist_bundle_isPlainObject(t){if(typeof t!=="object"||t===null)return false;if(Object.prototype.toString.call(t)!=="[object Object]")return false;const r=Object.getPrototypeOf(t);if(r===null)return true;const o=Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor;return typeof o==="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(t)}var noop=()=>"";async function fetchWrapper(t){const r=t.request?.fetch||globalThis.fetch;if(!r){throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing")}const o=t.request?.log||console;const i=t.request?.parseSuccessResponseBody!==false;const a=dist_bundle_isPlainObject(t.body)||Array.isArray(t.body)?JSONStringify(t.body):t.body;const c=Object.fromEntries(Object.entries(t.headers).map((([t,r])=>[t,String(r)])));let p;try{p=await r(t.url,{method:t.method,body:a,redirect:t.request?.redirect,headers:c,signal:t.request?.signal,...t.body&&{duplex:"half"}})}catch(r){let o="Unknown Error";if(r instanceof Error){if(r.name==="AbortError"){r.status=500;throw r}o=r.message;if(r.name==="TypeError"&&"cause"in r){if(r.cause instanceof Error){o=r.cause.message}else if(typeof r.cause==="string"){o=r.cause}}}const i=new RequestError(o,500,{request:t});i.cause=r;throw i}const u=p.status;const l=p.url;const d={};for(const[t,r]of p.headers){d[t]=r}const A={url:l,status:u,headers:d,data:""};if("deprecation"in d){const r=d.link&&d.link.match(/<([^<>]+)>; rel="deprecation"/);const i=r&&r.pop();o.warn(`[@octokit/request] "${t.method} ${t.url}" is deprecated. It is scheduled to be removed on ${d.sunset}${i?`. See ${i}`:""}`)}if(u===204||u===205){return A}if(t.method==="HEAD"){if(u<400){return A}throw new RequestError(p.statusText,u,{response:A,request:t})}if(u===304){A.data=await getResponseData(p);throw new RequestError("Not modified",u,{response:A,request:t})}if(u>=400){A.data=await getResponseData(p);throw new RequestError(toErrorMessage(A.data),u,{response:A,request:t})}A.data=i?await getResponseData(p):p.body;return A}async function getResponseData(t){const r=t.headers.get("content-type");if(!r){return t.text().catch(noop)}const o=(0,rf.xL)(r);if(isJSONResponse(o)){let r="";try{r=await t.text();return JSONParse(r)}catch(t){return r}}else if(o.type.startsWith("text/")||o.parameters.charset?.toLowerCase()==="utf-8"){return t.text().catch(noop)}else{return t.arrayBuffer().catch((
|
||||
/* v8 ignore next -- @preserve */
|
||||
()=>new ArrayBuffer(0)))}}function isJSONResponse(t){return t.type==="application/json"||t.type==="application/scim+json"}function toErrorMessage(t){if(typeof t==="string"){return t}if(t instanceof ArrayBuffer){return"Unknown error"}if("message"in t){const r="documentation_url"in t?` - ${t.documentation_url}`:"";return Array.isArray(t.errors)?`${t.message}: ${t.errors.map((t=>JSON.stringify(t))).join(", ")}${r}`:`${t.message}${r}`}return`Unknown error: ${JSON.stringify(t)}`}function dist_bundle_withDefaults(t,r){const o=t.defaults(r);const newApi=function(t,r){const i=o.merge(t,r);if(!i.request||!i.request.hook){return fetchWrapper(o.parse(i))}const request2=(t,r)=>fetchWrapper(o.parse(o.merge(t,r)));Object.assign(request2,{endpoint:o,defaults:dist_bundle_withDefaults.bind(null,o)});return i.request.hook(request2,i)};return Object.assign(newApi,{endpoint:o,defaults:dist_bundle_withDefaults.bind(null,o)})}var Mf=dist_bundle_withDefaults(tf,hf);
|
||||
/* v8 ignore next -- @preserve */
|
||||
/* v8 ignore else -- @preserve */var mf="0.0.0-development";function _buildMessageForResponseErrors(t){return`Request failed due to following response errors:\n`+t.errors.map((t=>` - ${t.message}`)).join("\n")}var gf=class extends Error{constructor(t,r,o){super(_buildMessageForResponseErrors(o));this.request=t;this.headers=r;this.response=o;this.errors=o.errors;this.data=o.data;if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}}name="GraphqlResponseError";errors;data};var zf=["method","baseUrl","url","headers","request","query","mediaType","operationName"];var Of=["query","method","url"];var yf=/\/api\/v3\/?$/;function graphql(t,r,o){if(o){if(typeof r==="string"&&"query"in o){return Promise.reject(new Error(`[@octokit/graphql] "query" cannot be used as variable name`))}for(const t in o){if(!Of.includes(t))continue;return Promise.reject(new Error(`[@octokit/graphql] "${t}" cannot be used as variable name`))}}const i=typeof r==="string"?Object.assign({query:r},o):r;const a=Object.keys(i).reduce(((t,r)=>{if(zf.includes(r)){t[r]=i[r];return t}if(!t.variables){t.variables={}}t.variables[r]=i[r];return t}),{});const c=i.baseUrl||t.endpoint.DEFAULTS.baseUrl;if(yf.test(c)){a.url=c.replace(yf,"/api/graphql")}return t(a).then((t=>{if(t.data.errors){const r={};for(const o of Object.keys(t.headers)){r[o]=t.headers[o]}throw new gf(a,r,t.data)}return t.data.data}))}function graphql_dist_bundle_withDefaults(t,r){const o=t.defaults(r);const newApi=(t,r)=>graphql(o,t,r);return Object.assign(newApi,{defaults:graphql_dist_bundle_withDefaults.bind(null,o),endpoint:o.endpoint})}var Ef=graphql_dist_bundle_withDefaults(Mf,{headers:{"user-agent":`octokit-graphql.js/${mf} ${getUserAgent()}`},method:"POST",url:"/graphql"});function withCustomRequest(t){return graphql_dist_bundle_withDefaults(t,{method:"POST",url:"/graphql"})}var Cf="(?:[a-zA-Z0-9_-]+)";var Bf="\\.";var If=new RegExp(`^${Cf}${Bf}${Cf}${Bf}${Cf}$`);var Rf=If.test.bind(If);async function auth(t){const r=Rf(t);const o=t.startsWith("v1.")||t.startsWith("ghs_");const i=t.startsWith("ghu_");const a=r?"app":o?"installation":i?"user-to-server":"oauth";return{type:"token",token:t,tokenType:a}}function withAuthorizationPrefix(t){if(t.split(/\./).length===3){return`bearer ${t}`}return`token ${t}`}async function hook(t,r,o,i){const a=r.endpoint.merge(o,i);a.headers.authorization=withAuthorizationPrefix(t);return r(a)}var Sf=function createTokenAuth2(t){if(!t){throw new Error("[@octokit/auth-token] No token passed to createTokenAuth")}if(typeof t!=="string"){throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string")}t=t.replace(/^(token|bearer) +/i,"");return Object.assign(auth.bind(null,t),{hook:hook.bind(null,t)})};const qf="7.0.6";const dist_src_noop=()=>{};const wf=console.warn.bind(console);const Nf=console.error.bind(console);function createLogger(t={}){if(typeof t.debug!=="function"){t.debug=dist_src_noop}if(typeof t.info!=="function"){t.info=dist_src_noop}if(typeof t.warn!=="function"){t.warn=wf}if(typeof t.error!=="function"){t.error=Nf}return t}const vf=`octokit-core.js/${qf} ${getUserAgent()}`;class Octokit{static VERSION=qf;static defaults(t){const r=class extends(this){constructor(...r){const o=r[0]||{};if(typeof t==="function"){super(t(o));return}super(Object.assign({},t,o,o.userAgent&&t.userAgent?{userAgent:`${o.userAgent} ${t.userAgent}`}:null))}};return r}static plugins=[];static plugin(...t){const r=this.plugins;const o=class extends(this){static plugins=r.concat(t.filter((t=>!r.includes(t))))};return o}constructor(t={}){const r=new JA.Collection;const o={baseUrl:Mf.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:r.bind(null,"request")}),mediaType:{previews:[],format:""}};o.headers["user-agent"]=t.userAgent?`${t.userAgent} ${vf}`:vf;if(t.baseUrl){o.baseUrl=t.baseUrl}if(t.previews){o.mediaType.previews=t.previews}if(t.timeZone){o.headers["time-zone"]=t.timeZone}this.request=Mf.defaults(o);this.graphql=withCustomRequest(this.request).defaults(o);this.log=createLogger(t.log);this.hook=r;if(!t.authStrategy){if(!t.auth){this.auth=async()=>({type:"unauthenticated"})}else{const o=Sf(t.auth);r.wrap("request",o.hook);this.auth=o}}else{const{authStrategy:o,...i}=t;const a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:i},t.auth));r.wrap("request",a.hook);this.auth=a}const i=this.constructor;for(let r=0;r<i.plugins.length;++r){Object.assign(this,i.plugins[r](this,t))}}request;graphql;log;hook;auth}const Tf="17.0.0";const Wf={actions:{addCustomLabelsToSelfHostedRunnerForOrg:["POST /orgs/{org}/actions/runners/{runner_id}/labels"],addCustomLabelsToSelfHostedRunnerForRepo:["POST /repos/{owner}/{repo}/actions/runners/{runner_id}/labels"],addRepoAccessToSelfHostedRunnerGroupInOrg:["PUT /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}"],addSelectedRepoToOrgSecret:["PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repositoLine truncated
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../webpack:/docker-metadata-action/node_modules/@actions/core/lib/command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/core.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/file-command.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/oidc-utils.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/path-utils.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/summary.js","../webpack:/docker-metadata-action/node_modules/@actions/core/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/exec/lib/exec.js","../webpack:/docker-metadata-action/node_modules/@actions/exec/lib/toolrunner.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/context.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/github.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/internal/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/github/lib/utils.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/lib/auth.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/lib/index.js","../webpack:/docker-metadata-action/node_modules/@actions/http-client/lib/proxy.js","../webpack:/docker-metadata-action/node_modules/@actions/io/lib/io-util.js","../webpack:/docker-metadata-action/node_modules/@actions/io/lib/io.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/lib/manifest.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/lib/retry-helper.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/lib/tool-cache.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/node_modules/semver/semver.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/node_modules/uuid/lib/bytesToUuid.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/node_modules/uuid/lib/rng.js","../webpack:/docker-metadata-action/node_modules/@actions/tool-cache/node_modules/uuid/v4.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/flags.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/for-each.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/reduce.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/instance/sort.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/create.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/parse-int.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/from.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/array/is-array.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator-method.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/get-iterator.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/instance/slice.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/core-js/symbol.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayLikeToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/arrayWithHoles.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/iterableToArrayLimit.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/nonIterableRest.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js","../webpack:/docker-metadata-action/node_modules/@babel/runtime-corejs3/helpers/unsuLine truncated
|
||||
{"version":3,"file":"index.js","names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","Object","defineProperty","exports","ClientStreamingCall","constructor","method","requestHeaders","request","headers","response","status","trailers","requests","onfulfilled","onrejected","promiseFinished","reason","all","Deferred","DeferredState","preventUnhandledRejectionWarning","_state","PENDING","_promise","_resolve","_reject","catch","_","state","promise","Error","toLowerCase","RESOLVED","REJECTED","resolvePending","val","rejectPending","DuplexStreamingCall","responses","__webpack_unused_export__","service_type_1","__webpack_require__","enumerable","get","ServiceType","reflection_info_1","readMethodOptions","readMethodOption","readServiceOption","rpc_error_1","RpcError","rpc_options_1","mergeRpcOptions","rpc_output_stream_1","RpcOutputStreamController","test_transport_1","TestTransport","deferred_1","duplex_streaming_call_1","client_streaming_call_1","server_streaming_call_1","ServerStreamingCall","unary_call_1","UnaryCall","rpc_interceptor_1","stackIntercept","stackDuplexStreamingInterceptors","stackClientStreamingInterceptors","stackServerStreamingInterceptors","stackUnaryInterceptors","server_call_context_1","ServerCallContextController","normalizeMethodInfo","runtime_1","service","_a","_b","_c","m","localName","lowerCamelCase","name","serverStreaming","clientStreaming","options","idempotency","undefined","methodName","extensionName","extensionType","methods","find","i","fromJson","optionVal","message","code","meta","super","setPrototypeOf","prototype","toString","l","push","serviceName","entries","length","k","v","join","kind","transport","input","_d","tail","mtd","inp","opt","unary","curr","interceptors","filter","interceptUnary","reverse","interceptServerStreaming","interceptClientStreaming","duplex","interceptDuplex","assertNever","defaults","o","copy","key","keys","jsonOptions","mergeJsonOptions","binaryOptions","mergeBinaryOptions","concat","a","into","c","Date","getTime","Array","isArray","_lis","nxt","msg","err","cmp","_closed","_itState","q","onNext","callback","addLis","onMessage","onError","onComplete","list","indexOf","splice","clearLis","values","closed","notifyNext","error","complete","assert","notifyMessage","notifyError","notifyComplete","pushIt","forEach","Symbol","asyncIterator","p","first","shift","deadline","sendResponseHeadersFn","defaultStatus","detail","_cancelled","_listeners","_sendRH","notifyCancelled","sendResponseHeaders","data","cancelled","onCancel","typeName","map","suppressUncaughtRejections","headerDelay","responseDelay","betweenResponseDelay","afterResponseDelay","sentMessages","lastInput","TestInputStream","sent","single","sendComplete","completed","promiseHeaders","defaultHeaders","promiseSingleResponse","r","O","create","is","streamResponses","stream","abort","messages","delay","promiseStatus","promiseTrailers","defaultTrailers","maybeSuppressUncaught","mergeOptions","headersPromise","responsePromise","statusPromise","trailersPromise","outputStream","responseStreamClosedPromise","responseHeader","responseTrailer","ms","aborted","id","setTimeout","addEventListener","ev","clearTimeout","_completed","_sent","send","inputMessage","delayMs","inputComplete","assertFloat32","assertUInt32","assertInt32","condition","FLOAT32_MAX","FLOAT32_MIN","UINT32_MAX","INT32_MAX","INT32_MIN","arg","Number","isInteger","isFinite","base64encode","base64decode","encTable","split","decTable","charCodeAt","base64Str","es","bytes","Uint8Array","bytePos","groupPos","b","subarray","base64","WireType","UnknownFieldHandler","symbol","for","onRead","fieldNo","wireType","container","no","onWrite","writer","tag","raw","uf","last","slice","assign","BinaryReader","binaryReadOptions","binary_format_contract_1","pb_long_1","goog_varint_1","defaultsRead","readUnknownField","readerFactory","buf","textDecoder","varint64","varint64read","uint32","varint32read","len","pos","view","DataView","buffer","byteOffset","byteLength","TextDecoder","fatal","ignoreBOM","skip","start","Varint","Bit64","Bit32","LengthDelimited","StartGroup","t","EndGroup","assertBounds","RangeError","int32","sint32","zze","int64","PbLong","uint64","PbULong","sint64","lo","hi","s","bool","fixed32","getUint32","sfixed32","getInt32","fixed64","sfixed64","float","getFloat32","double","getFloat64","string","decode","BinaryWriter","binaryWriteOptions","assert_1","defaultsWrite","writeUnknownFields","writerFactory","textEncoder","stack","TextEncoder","chunks","finish","offset","set","fork","chunk","prev","pop","type","varint32write","encode","setFloat32","setFloat64","setUint32","setInt32","long","from","varint64write","sign","listEnumNumbers","listEnumNames","listEnumValues","isEnumObject","hasOwnProperty","num","parseInt","isNaN","nam","enumObject","number","index","arr","int64toString","int64fromString","lowBits","highBits","mLine truncated
|
||||
+2
-1420
File diff suppressed because it is too large.
Load diff
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
(()=>{var e={296:e=>{var r=Object.prototype.toString;var n=typeof Buffer!=="undefined"&&typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},599:(e,r,n)=>{e=n.nmd(e);var t=n(927).SourceMapConsumer;var o=n(928);var i;try{i=n(896);if(!i.existsSync||!i.readFileSync){i=null}}catch(e){}var a=n(296);function dynamicRequire(e,r){return e.require(r)}var u=false;var s=false;var l=false;var c="auto";var p={};var f={};var g=/^data:application\/json[^,]+base64,/;var d=[];var h=[];function isInBrowser(){if(c==="browser")return true;if(c==="node")return false;return typeof window!=="undefined"&&typeof XMLHttpRequest==="function"&&!(window.require&&window.module&&window.process&&window.process.type==="renderer")}function hasGlobalProcessEventEmitter(){return typeof process==="object"&&process!==null&&typeof process.on==="function"}function globalProcessVersion(){if(typeof process==="object"&&process!==null){return process.version}else{return""}}function globalProcessStderr(){if(typeof process==="object"&&process!==null){return process.stderr}}function globalProcessExit(e){if(typeof process==="object"&&process!==null&&typeof process.exit==="function"){return process.exit(e)}}function handlerExec(e){return function(r){for(var n=0;n<e.length;n++){var t=e[n](r);if(t){return t}}return null}}var m=handlerExec(d);d.push((function(e){e=e.trim();if(/^file:/.test(e)){e=e.replace(/file:\/\/\/(\w:)?/,(function(e,r){return r?"":"/"}))}if(e in p){return p[e]}var r="";try{if(!i){var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);if(n.readyState===4&&n.status===200){r=n.responseText}}else if(i.existsSync(e)){r=i.readFileSync(e,"utf8")}}catch(e){}return p[e]=r}));function supportRelativeURL(e,r){if(!e)return r;var n=o.dirname(e);var t=/^\w+:\/\/[^\/]*/.exec(n);var i=t?t[0]:"";var a=n.slice(i.length);if(i&&/^\/\w\:/.test(a)){i+="/";return i+o.resolve(n.slice(i.length),r).replace(/\\/g,"/")}return i+o.resolve(n.slice(i.length),r)}function retrieveSourceMapURL(e){var r;if(isInBrowser()){try{var n=new XMLHttpRequest;n.open("GET",e,false);n.send(null);r=n.readyState===4?n.responseText:null;var t=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(t){return t}}catch(e){}}r=m(e);var o=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;var i,a;while(a=o.exec(r))i=a;if(!i)return null;return i[1]}var v=handlerExec(h);h.push((function(e){var r=retrieveSourceMapURL(e);if(!r)return null;var n;if(g.test(r)){var t=r.slice(r.indexOf(",")+1);n=a(t,"base64").toString();r=e}else{r=supportRelativeURL(e,r);n=m(r)}if(!n){return null}return{url:r,map:n}}));function mapSourcePosition(e){var r=f[e.source];if(!r){var n=v(e.source);if(n){r=f[e.source]={url:n.url,map:new t(n.map)};if(r.map.sourcesContent){r.map.sources.forEach((function(e,n){var t=r.map.sourcesContent[n];if(t){var o=supportRelativeURL(r.url,e);p[o]=t}}))}}else{r=f[e.source]={url:null,map:null}}}if(r&&r.map&&typeof r.map.originalPositionFor==="function"){var o=r.map.originalPositionFor(e);if(o.source!==null){o.source=supportRelativeURL(r.url,o.source);return o}}return e}function mapEvalOrigin(e){var r=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(e);if(r){var n=mapSourcePosition({source:r[2],line:+r[3],column:r[4]-1});return"eval at "+r[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}r=/^eval at ([^(]+) \((.+)\)$/.exec(e);if(r){return"eval at "+r[1]+" ("+mapEvalOrigin(r[2])+")"}return e}function CallSiteToString(){var e;var r="";if(this.isNative()){r="native"}else{e=this.getScriptNameOrSourceURL();if(!e&&this.isEval()){r=this.getEvalOrigin();r+=", "}if(e){r+=e}else{r+="<anonymous>"}var n=this.getLineNumber();if(n!=null){r+=":"+n;var t=this.getColumnNumber();if(t){r+=":"+t}}}var o="";var i=this.getFunctionName();var a=true;var u=this.isConstructor();var s=!(this.isToplevel()||u);if(s){var l=this.getTypeName();if(l==="[object Object]"){l="null"}var c=this.getMethodName();if(i){if(l&&i.indexOf(l)!=0){o+=l+"."}o+=i;if(c&&i.indexOf("."+c)!=i.length-c.length-1){o+=" [as "+c+"]"}}else{o+=l+"."+(c||"<anonymous>")}}else if(u){o+="new "+(i||"<aLine truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
(()=>{var e={650:e=>{var r=Object.prototype.toString;var n=typeof Buffer.alloc==="function"&&typeof Buffer.allocUnsafe==="function"&&typeof Buffer.from==="function";function isArrayBuffer(e){return r.call(e).slice(8,-1)==="ArrayBuffer"}function fromArrayBuffer(e,r,t){r>>>=0;var o=e.byteLength-r;if(o<0){throw new RangeError("'offset' is out of bounds")}if(t===undefined){t=o}else{t>>>=0;if(t>o){throw new RangeError("'length' is out of bounds")}}return n?Buffer.from(e.slice(r,r+t)):new Buffer(new Uint8Array(e.slice(r,r+t)))}function fromString(e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}return n?Buffer.from(e,r):new Buffer(e,r)}function bufferFrom(e,r,t){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(isArrayBuffer(e)){return fromArrayBuffer(e,r,t)}if(typeof e==="string"){return fromString(e,r)}return n?Buffer.from(e):new Buffer(e)}e.exports=bufferFrom},274:(e,r,n)=>{var t=n(339);var o=Object.prototype.hasOwnProperty;var i=typeof Map!=="undefined";function ArraySet(){this._array=[];this._set=i?new Map:Object.create(null)}ArraySet.fromArray=function ArraySet_fromArray(e,r){var n=new ArraySet;for(var t=0,o=e.length;t<o;t++){n.add(e[t],r)}return n};ArraySet.prototype.size=function ArraySet_size(){return i?this._set.size:Object.getOwnPropertyNames(this._set).length};ArraySet.prototype.add=function ArraySet_add(e,r){var n=i?e:t.toSetString(e);var a=i?this.has(e):o.call(this._set,n);var u=this._array.length;if(!a||r){this._array.push(e)}if(!a){if(i){this._set.set(e,u)}else{this._set[n]=u}}};ArraySet.prototype.has=function ArraySet_has(e){if(i){return this._set.has(e)}else{var r=t.toSetString(e);return o.call(this._set,r)}};ArraySet.prototype.indexOf=function ArraySet_indexOf(e){if(i){var r=this._set.get(e);if(r>=0){return r}}else{var n=t.toSetString(e);if(o.call(this._set,n)){return this._set[n]}}throw new Error('"'+e+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length){return this._array[e]}throw new Error("No element indexed by "+e)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};r.I=ArraySet},449:(e,r,n)=>{var t=n(190);var o=5;var i=1<<o;var a=i-1;var u=i;function toVLQSigned(e){return e<0?(-e<<1)+1:(e<<1)+0}function fromVLQSigned(e){var r=(e&1)===1;var n=e>>1;return r?-n:n}r.encode=function base64VLQ_encode(e){var r="";var n;var i=toVLQSigned(e);do{n=i&a;i>>>=o;if(i>0){n|=u}r+=t.encode(n)}while(i>0);return r};r.decode=function base64VLQ_decode(e,r,n){var i=e.length;var s=0;var l=0;var c,p;do{if(r>=i){throw new Error("Expected more digits in base 64 VLQ value.")}p=t.decode(e.charCodeAt(r++));if(p===-1){throw new Error("Invalid base64 digit: "+e.charAt(r-1))}c=!!(p&u);p&=a;s=s+(p<<l);l+=o}while(c);n.value=fromVLQSigned(s);n.rest=r}},190:(e,r)=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(e){if(0<=e&&e<n.length){return n[e]}throw new TypeError("Must be between 0 and 63: "+e)};r.decode=function(e){var r=65;var n=90;var t=97;var o=122;var i=48;var a=57;var u=43;var s=47;var l=26;var c=52;if(r<=e&&e<=n){return e-r}if(t<=e&&e<=o){return e-t+l}if(i<=e&&e<=a){return e-i+c}if(e==u){return 62}if(e==s){return 63}return-1}},345:(e,r)=>{r.GREATEST_LOWER_BOUND=1;r.LEAST_UPPER_BOUND=2;function recursiveSearch(e,n,t,o,i,a){var u=Math.floor((n-e)/2)+e;var s=i(t,o[u],true);if(s===0){return u}else if(s>0){if(n-u>1){return recursiveSearch(u,n,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return n<o.length?n:-1}else{return u}}else{if(u-e>1){return recursiveSearch(e,u,t,o,i,a)}if(a==r.LEAST_UPPER_BOUND){return u}else{return e<0?-1:e}}}r.search=function search(e,n,t,o){if(n.length===0){return-1}var i=recursiveSearch(-1,n.length,e,n,t,o||r.GREATEST_LOWER_BOUND);if(i<0){return-1}while(i-1>=0){if(t(n[i],n[i-1],true)!==0){break}--i}return i}},680:(e,r,n)=>{var t=n(339);function generatedPositionAfter(e,r){var n=e.generatedLine;var o=r.generatedLine;var i=e.generatedColumn;var a=r.generatedColumn;return o>n||o==n&&a>=i||t.compareByGeneratedPositionsInflated(e,r)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(e,r){this._array.forEach(e,r)};MappingList.prototype.add=function MappingList_add(e){if(generatedPositionAfter(this._last,e)){this._last=e;this._array.push(e)}else{this._sorted=false;this._array.push(e)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(t.compareByGeneratedPositionsInflated);this._sorted=true}return this._array};r.H=MappingList},758:(e,r)=>{function swap(e,r,n){var t=e[r];e[r]=e[n];e[n]=t}function randomIntInRange(e,r){return Math.round(e+Math.random()*(r-e))}function doQuickSort(e,r,n,t){if(n<t){var o=randomIntInRange(n,t);var i=n-1;swap(e,o,t);var a=e[t];for(var u=n;u<t;u++){if(r(e[u],Line truncated
|
||||
+15
-2
@@ -1,9 +1,15 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
|
||||
group "pre-checkin" {
|
||||
targets = ["vendor-update", "format", "build"]
|
||||
targets = ["vendor", "format", "build"]
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
@@ -11,42 +17,49 @@ group "validate" {
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor-update" {
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import {defineConfig} from 'eslint/config';
|
||||
import js from '@eslint/js';
|
||||
import tseslint from '@typescript-eslint/eslint-plugin';
|
||||
import vitest from '@vitest/eslint-plugin';
|
||||
import globals from 'globals';
|
||||
import eslintConfigPrettier from 'eslint-config-prettier/flat';
|
||||
import eslintPluginPrettier from 'eslint-plugin-prettier';
|
||||
|
||||
export default defineConfig([
|
||||
{
|
||||
ignores: ['.yarn/**/*', 'coverage/**/*', 'dist/**/*']
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs['flat/recommended'],
|
||||
eslintConfigPrettier,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['__tests__/**'],
|
||||
...vitest.configs.recommended,
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.node,
|
||||
...vitest.environments.env.globals
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
...vitest.configs.recommended.rules,
|
||||
'vitest/no-conditional-expect': 'error',
|
||||
'vitest/no-disabled-tests': 0
|
||||
}
|
||||
},
|
||||
{
|
||||
plugins: {
|
||||
prettier: eslintPluginPrettier
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'@typescript-eslint/no-require-imports': [
|
||||
'error',
|
||||
{
|
||||
allowAsImport: true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]);
|
||||
@@ -1,31 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-'));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/metadata-action',
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
testEnvironment: 'node',
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
setupFiles: ['dotenv/config'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||
},
|
||||
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
|
||||
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__mocks__/', '__tests__/'],
|
||||
verbose: true
|
||||
};
|
||||
+32
-37
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "docker-metadata-action",
|
||||
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
||||
"main": "lib/main.js",
|
||||
"type": "module",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
||||
"test": "jest --coverage",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint --max-warnings=0 .",
|
||||
"format": "eslint --fix .",
|
||||
"test": "vitest run"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -20,41 +20,36 @@
|
||||
"tag",
|
||||
"label"
|
||||
],
|
||||
"author": "Docker",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "CrazyMax",
|
||||
"url": "https://crazymax.dev"
|
||||
}
|
||||
],
|
||||
"author": "Docker Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@4.9.2",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@docker/actions-toolkit": "^0.5.0",
|
||||
"@actions/core": "^3.0.0",
|
||||
"@actions/github": "^9.0.0",
|
||||
"@docker/actions-toolkit": "^0.79.0",
|
||||
"@renovate/pep440": "^1.0.0",
|
||||
"csv-parse": "^5.4.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"moment": "^2.29.4",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"semver": "^7.5.0"
|
||||
"csv-parse": "^6.1.0",
|
||||
"handlebars": "^4.7.8",
|
||||
"moment": "^2.30.1",
|
||||
"moment-timezone": "^0.6.0",
|
||||
"semver": "^7.7.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/csv-parse": "^1.2.2",
|
||||
"@types/node": "^16.18.23",
|
||||
"@types/semver": "^7.3.13",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"@vercel/ncc": "^0.36.1",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^2.8.7",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5"
|
||||
"@eslint/js": "^9.39.3",
|
||||
"@types/node": "^24.11.0",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||
"@typescript-eslint/parser": "^8.56.1",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/eslint-plugin": "^1.6.9",
|
||||
"dotenv": "^17.3.1",
|
||||
"eslint": "^9.39.3",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"globals": "^17.3.0",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
+78
-13
@@ -1,8 +1,15 @@
|
||||
import * as core from '@actions/core';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||
|
||||
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git.js';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github/github.js';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
|
||||
type GithubContext = typeof GitHub.context;
|
||||
|
||||
export interface Context extends GithubContext {
|
||||
commitDate: Date;
|
||||
}
|
||||
|
||||
export interface Inputs {
|
||||
context: ContextSource;
|
||||
@@ -10,8 +17,10 @@ export interface Inputs {
|
||||
tags: string[];
|
||||
flavor: string[];
|
||||
labels: string[];
|
||||
annotations: string[];
|
||||
sepTags: string;
|
||||
sepLabels: string;
|
||||
sepAnnotations: string;
|
||||
bakeTarget: string;
|
||||
githubToken: string;
|
||||
}
|
||||
@@ -19,12 +28,14 @@ export interface Inputs {
|
||||
export function getInputs(): Inputs {
|
||||
return {
|
||||
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
||||
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
||||
sepAnnotations: core.getInput('sep-annotations', {trimWhitespace: false}) || `\n`,
|
||||
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
|
||||
githubToken: core.getInput('github-token')
|
||||
};
|
||||
@@ -35,10 +46,10 @@ export enum ContextSource {
|
||||
git = 'git'
|
||||
}
|
||||
|
||||
export async function getContext(source: ContextSource): Promise<Context> {
|
||||
export async function getContext(source: ContextSource, toolkit: Toolkit): Promise<Context> {
|
||||
switch (source) {
|
||||
case ContextSource.workflow:
|
||||
return getContextFromWorkflow();
|
||||
return await getContextFromWorkflow(toolkit);
|
||||
case ContextSource.git:
|
||||
return await getContextFromGit();
|
||||
default:
|
||||
@@ -46,7 +57,7 @@ export async function getContext(source: ContextSource): Promise<Context> {
|
||||
}
|
||||
}
|
||||
|
||||
function getContextFromWorkflow(): Context {
|
||||
async function getContextFromWorkflow(toolkit: Toolkit): Promise<Context> {
|
||||
const context = GitHub.context;
|
||||
|
||||
// Needs to override Git reference with pr ref instead of upstream branch ref
|
||||
@@ -65,9 +76,63 @@ function getContextFromWorkflow(): Context {
|
||||
}
|
||||
}
|
||||
|
||||
return context;
|
||||
return {
|
||||
commitDate: await getCommitDateFromWorkflow(context.sha, toolkit),
|
||||
...context
|
||||
} as Context;
|
||||
}
|
||||
|
||||
async function getContextFromGit(): Promise<Context> {
|
||||
return await Git.context();
|
||||
const ctx = await Git.context();
|
||||
|
||||
return {
|
||||
commitDate: await Git.commitDate(ctx.sha),
|
||||
...ctx
|
||||
} as Context;
|
||||
}
|
||||
|
||||
async function getCommitDateFromWorkflow(sha: string, toolkit: Toolkit): Promise<Date> {
|
||||
const event = GitHub.context.payload as unknown as {
|
||||
// branch push
|
||||
commits?: Array<{
|
||||
timestamp: string;
|
||||
// commit sha
|
||||
id: string;
|
||||
}>;
|
||||
// tags
|
||||
head_commit?: {
|
||||
timestamp: string;
|
||||
// commit sha
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
|
||||
if (event.commits) {
|
||||
const commitDate = event.commits.find(x => x.id === sha)?.timestamp;
|
||||
if (commitDate) {
|
||||
return new Date(commitDate);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.head_commit) {
|
||||
if (event.head_commit.id === sha) {
|
||||
return new Date(event.head_commit.timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
// fallback to github api for commit date
|
||||
try {
|
||||
const commit = await toolkit.github.octokit.rest.repos.getCommit({
|
||||
owner: GitHub.context.repo.owner,
|
||||
repo: GitHub.context.repo.repo,
|
||||
ref: sha
|
||||
});
|
||||
if (commit.data.commit.committer?.date) {
|
||||
return new Date(commit.data.commit.committer.date);
|
||||
}
|
||||
throw new Error('Committer date not found');
|
||||
} catch (error) {
|
||||
core.debug(`Failed to get commit date from GitHub API: ${error.message}`);
|
||||
return new Date();
|
||||
}
|
||||
}
|
||||
+51
-21
@@ -1,27 +1,20 @@
|
||||
import * as fs from 'fs';
|
||||
import * as core from '@actions/core';
|
||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit.js';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util.js';
|
||||
|
||||
import {getContext, getInputs, Inputs} from './context';
|
||||
import {Meta, Version} from './meta';
|
||||
|
||||
function setOutput(name: string, value: string) {
|
||||
core.setOutput(name, value);
|
||||
core.exportVariable(`DOCKER_METADATA_OUTPUT_${name.replace(/\W/g, '_').toUpperCase()}`, value);
|
||||
}
|
||||
import {getContext, getInputs, Inputs} from './context.js';
|
||||
import {Meta, Version} from './meta.js';
|
||||
|
||||
actionsToolkit.run(
|
||||
// main
|
||||
async () => {
|
||||
const inputs: Inputs = getInputs();
|
||||
if (inputs.images.length == 0) {
|
||||
throw new Error(`images input required`);
|
||||
}
|
||||
|
||||
const toolkit = new Toolkit({githubToken: inputs.githubToken});
|
||||
const context = await getContext(inputs.context);
|
||||
const context = await getContext(inputs.context, toolkit);
|
||||
const repo = await toolkit.github.repoData();
|
||||
const setOutput = outputEnvEnabled() ? setOutputAndEnv : core.setOutput;
|
||||
|
||||
await core.group(`Context info`, async () => {
|
||||
core.info(`eventName: ${context.eventName}`);
|
||||
@@ -32,6 +25,7 @@ actionsToolkit.run(
|
||||
core.info(`actor: ${context.actor}`);
|
||||
core.info(`runNumber: ${context.runNumber}`);
|
||||
core.info(`runId: ${context.runId}`);
|
||||
core.info(`commitDate: ${context.commitDate}`);
|
||||
});
|
||||
|
||||
if (core.isDebug()) {
|
||||
@@ -53,7 +47,7 @@ actionsToolkit.run(
|
||||
setOutput('version', version.main || '');
|
||||
|
||||
// Docker tags
|
||||
const tags: Array<string> = meta.getTags();
|
||||
const tags = meta.getTags();
|
||||
if (tags.length == 0) {
|
||||
core.warning('No Docker tag has been generated. Check tags input.');
|
||||
} else {
|
||||
@@ -64,6 +58,7 @@ actionsToolkit.run(
|
||||
});
|
||||
}
|
||||
setOutput('tags', tags.join(inputs.sepTags));
|
||||
setOutput('tag-names', meta.getTags(true).join(inputs.sepTags));
|
||||
|
||||
// Docker labels
|
||||
const labels: Array<string> = meta.getLabels();
|
||||
@@ -74,18 +69,53 @@ actionsToolkit.run(
|
||||
setOutput('labels', labels.join(inputs.sepLabels));
|
||||
});
|
||||
|
||||
// Annotations
|
||||
const annotationsRaw: Array<string> = meta.getAnnotations();
|
||||
const annotationsLevels = process.env.DOCKER_METADATA_ANNOTATIONS_LEVELS || 'manifest';
|
||||
await core.group(`Annotations`, async () => {
|
||||
const annotations: Array<string> = [];
|
||||
for (const level of annotationsLevels.split(',')) {
|
||||
annotations.push(
|
||||
...annotationsRaw.map(label => {
|
||||
const v = `${level}:${label}`;
|
||||
core.info(v);
|
||||
return v;
|
||||
})
|
||||
);
|
||||
}
|
||||
setOutput(`annotations`, annotations.join(inputs.sepAnnotations));
|
||||
});
|
||||
|
||||
// JSON
|
||||
const jsonOutput = meta.getJSON();
|
||||
const jsonOutput = meta.getJSON(annotationsLevels.split(','));
|
||||
await core.group(`JSON output`, async () => {
|
||||
core.info(JSON.stringify(jsonOutput, null, 2));
|
||||
setOutput('json', JSON.stringify(jsonOutput));
|
||||
});
|
||||
|
||||
// Bake file definition
|
||||
const bakeFile: string = meta.getBakeFile();
|
||||
await core.group(`Bake file definition`, async () => {
|
||||
core.info(fs.readFileSync(bakeFile, 'utf8'));
|
||||
setOutput('bake-file', bakeFile);
|
||||
});
|
||||
// Bake files
|
||||
for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) {
|
||||
const outputName = kind.split(':')[0];
|
||||
const bakeFile: string = meta.getBakeFile(kind);
|
||||
await core.group(`Bake file definition (${outputName})`, async () => {
|
||||
core.info(fs.readFileSync(bakeFile, 'utf8'));
|
||||
setOutput(`bake-file-${outputName}`, bakeFile);
|
||||
});
|
||||
}
|
||||
|
||||
// Bake file with tags and labels
|
||||
setOutput(`bake-file`, `${meta.getBakeFileTagsLabels()}`);
|
||||
}
|
||||
);
|
||||
|
||||
function setOutputAndEnv(name: string, value: string) {
|
||||
core.setOutput(name, value);
|
||||
core.exportVariable(`DOCKER_METADATA_OUTPUT_${name.replace(/\W/g, '_').toUpperCase()}`, value);
|
||||
}
|
||||
|
||||
function outputEnvEnabled(): boolean {
|
||||
if (process.env.DOCKER_METADATA_SET_OUTPUT_ENV) {
|
||||
return Util.parseBool(process.env.DOCKER_METADATA_SET_OUTPUT_ENV);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
+196
-57
@@ -5,14 +5,15 @@ import moment from 'moment-timezone';
|
||||
import * as pep440 from '@renovate/pep440';
|
||||
import * as semver from 'semver';
|
||||
import * as core from '@actions/core';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
import {Context as ToolkitContext} from '@docker/actions-toolkit/lib/context';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
|
||||
import {Context as ToolkitContext} from '@docker/actions-toolkit/lib/context.js';
|
||||
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github/github.js';
|
||||
|
||||
import {Inputs} from './context';
|
||||
import * as icl from './image';
|
||||
import * as tcl from './tag';
|
||||
import * as fcl from './flavor';
|
||||
import {Inputs, Context} from './context.js';
|
||||
import * as icl from './image.js';
|
||||
import * as tcl from './tag.js';
|
||||
import * as fcl from './flavor.js';
|
||||
|
||||
const defaultShortShaLength = 7;
|
||||
|
||||
export interface Version {
|
||||
main: string | undefined;
|
||||
@@ -113,6 +114,7 @@ export class Meta {
|
||||
}
|
||||
|
||||
const currentDate = this.date;
|
||||
const commitDate = this.context.commitDate;
|
||||
const vraw = this.setValue(
|
||||
handlebars.compile(tag.attrs['pattern'])({
|
||||
date: function (format, options) {
|
||||
@@ -128,6 +130,20 @@ export class Meta {
|
||||
}
|
||||
});
|
||||
return m.tz(tz).format(format);
|
||||
},
|
||||
commit_date: function (format, options) {
|
||||
const m = moment(commitDate);
|
||||
let tz = 'UTC';
|
||||
Object.keys(options.hash).forEach(key => {
|
||||
switch (key) {
|
||||
case 'tz':
|
||||
tz = options.hash[key];
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown ${key} attribute`);
|
||||
}
|
||||
});
|
||||
return m.tz(tz).format(format);
|
||||
}
|
||||
}),
|
||||
tag
|
||||
@@ -145,8 +161,20 @@ export class Meta {
|
||||
if (tag.attrs['value'].length > 0) {
|
||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||
} else {
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//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)) {
|
||||
core.warning(`${vraw} is not a valid semver. More info: https://semver.org/`);
|
||||
return version;
|
||||
@@ -179,8 +207,20 @@ export class Meta {
|
||||
if (tag.attrs['value'].length > 0) {
|
||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||
} else {
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//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)) {
|
||||
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
||||
return version;
|
||||
@@ -307,7 +347,7 @@ export class Meta {
|
||||
|
||||
let val = this.context.sha;
|
||||
if (tag.attrs['format'] === tcl.ShaFormat.Short) {
|
||||
val = this.context.sha.substring(0, 7);
|
||||
val = Meta.shortSha(this.context.sha);
|
||||
}
|
||||
|
||||
const vraw = this.setValue(val, tag);
|
||||
@@ -336,7 +376,7 @@ export class Meta {
|
||||
if (hp.body.length == 1 && hp.body[0].type == 'MustacheStatement') {
|
||||
return hp.body[0]['path']['parts'].length == 1 && hp.body[0]['path']['parts'][0] == 'raw';
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
@@ -356,9 +396,10 @@ export class Meta {
|
||||
return val;
|
||||
}
|
||||
|
||||
private setGlobalExp(val): string {
|
||||
private setGlobalExp(val: string): string {
|
||||
const context = this.context;
|
||||
const currentDate = this.date;
|
||||
const commitDate = this.context.commitDate;
|
||||
return handlebars.compile(val)({
|
||||
branch: function () {
|
||||
if (!/^refs\/heads\//.test(context.ref)) {
|
||||
@@ -373,7 +414,7 @@ export class Meta {
|
||||
return context.ref.replace(/^refs\/tags\//g, '');
|
||||
},
|
||||
sha: function () {
|
||||
return context.sha.substring(0, 7);
|
||||
return Meta.shortSha(context.sha);
|
||||
},
|
||||
base_ref: function () {
|
||||
if (/^refs\/tags\//.test(context.ref) && context.payload?.base_ref != undefined) {
|
||||
@@ -386,6 +427,20 @@ export class Meta {
|
||||
}
|
||||
return '';
|
||||
},
|
||||
commit_date: function (format, options) {
|
||||
const m = moment(commitDate);
|
||||
let tz = 'UTC';
|
||||
Object.keys(options.hash).forEach(key => {
|
||||
switch (key) {
|
||||
case 'tz':
|
||||
tz = options.hash[key];
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown ${key} attribute`);
|
||||
}
|
||||
});
|
||||
return m.tz(tz).format(format);
|
||||
},
|
||||
is_default_branch: function () {
|
||||
const branch = context.ref.replace(/^refs\/heads\//g, '');
|
||||
// TODO: "base_ref" is available in the push payload but doesn't always seem to
|
||||
@@ -408,6 +463,9 @@ export class Meta {
|
||||
}
|
||||
return 'false';
|
||||
},
|
||||
is_not_default_branch: function () {
|
||||
return this.is_default_branch() === 'false' ? 'true' : 'false';
|
||||
},
|
||||
date: function (format, options) {
|
||||
const m = moment(currentDate);
|
||||
let tz = 'UTC';
|
||||
@@ -436,26 +494,51 @@ export class Meta {
|
||||
return images;
|
||||
}
|
||||
|
||||
public getTags(): Array<string> {
|
||||
public getTags(namesOnly?: boolean): Array<string> {
|
||||
if (!this.version.main) {
|
||||
return [];
|
||||
}
|
||||
if (namesOnly) {
|
||||
return this.generateTags(this.version.main);
|
||||
}
|
||||
|
||||
const tags: Array<string> = [];
|
||||
for (const imageName of this.getImageNames()) {
|
||||
tags.push(`${imageName}:${this.version.main}`);
|
||||
for (const partial of this.version.partial) {
|
||||
tags.push(`${imageName}:${partial}`);
|
||||
}
|
||||
if (this.version.latest) {
|
||||
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
|
||||
tags.push(`${imageName}:${Meta.sanitizeTag(latestTag)}`);
|
||||
const images = this.getImageNames();
|
||||
if (images.length > 0) {
|
||||
for (const imageName of images) {
|
||||
tags.push(...this.generateTags(this.version.main, imageName));
|
||||
}
|
||||
} else {
|
||||
tags.push(...this.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;
|
||||
}
|
||||
|
||||
public getLabels(): Array<string> {
|
||||
const labels: Array<string> = [
|
||||
return this.getOCIAnnotationsWithCustoms(this.inputs.labels);
|
||||
}
|
||||
|
||||
public getAnnotations(): Array<string> {
|
||||
return this.getOCIAnnotationsWithCustoms(this.inputs.annotations);
|
||||
}
|
||||
|
||||
private getOCIAnnotationsWithCustoms(extra: string[]): Array<string> {
|
||||
const res: Array<string> = [
|
||||
`org.opencontainers.image.title=${this.repo.name || ''}`,
|
||||
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
||||
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
||||
@@ -465,11 +548,13 @@ export class Meta {
|
||||
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||
];
|
||||
labels.push(...this.inputs.labels);
|
||||
extra.forEach(label => {
|
||||
res.push(this.setGlobalExp(label));
|
||||
});
|
||||
|
||||
return Array.from(
|
||||
new Map<string, string>(
|
||||
labels
|
||||
res
|
||||
.map(label => label.split('='))
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
.filter(([_key, ...values]) => values.length > 0)
|
||||
@@ -480,8 +565,70 @@ export class Meta {
|
||||
.map(([key, value]) => `${key}=${value}`);
|
||||
}
|
||||
|
||||
public getJSON(): unknown {
|
||||
public getJSON(alevels: string[]): unknown {
|
||||
const annotations: Array<string> = [];
|
||||
for (const level of alevels) {
|
||||
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||
}
|
||||
return {
|
||||
tags: this.getTags(),
|
||||
'tag-names': this.getTags(true),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {}),
|
||||
annotations: annotations
|
||||
};
|
||||
}
|
||||
|
||||
public getBakeFile(kind: string): string {
|
||||
if (kind == 'tags') {
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
tags: this.getTags(),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
},
|
||||
kind
|
||||
);
|
||||
} else if (kind == 'labels') {
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {})
|
||||
},
|
||||
kind
|
||||
);
|
||||
} else if (kind.startsWith('annotations:')) {
|
||||
const name = kind.split(':')[0];
|
||||
const annotations: Array<string> = [];
|
||||
for (const level of kind.split(':')[1].split(',')) {
|
||||
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||
}
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
annotations: annotations
|
||||
},
|
||||
name
|
||||
);
|
||||
}
|
||||
throw new Error(`Unknown bake file type: ${kind}`);
|
||||
}
|
||||
|
||||
public getBakeFileTagsLabels(): string {
|
||||
return this.generateBakeFile({
|
||||
tags: this.getTags(),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
@@ -490,39 +637,17 @@ export class Meta {
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {})
|
||||
};
|
||||
}, {}),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public getBakeFile(): string {
|
||||
const bakeFile = path.join(ToolkitContext.tmpDir(), 'docker-metadata-action-bake.json');
|
||||
fs.writeFileSync(
|
||||
bakeFile,
|
||||
JSON.stringify(
|
||||
{
|
||||
target: {
|
||||
[this.inputs.bakeTarget]: {
|
||||
tags: this.getTags(),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {}),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
|
||||
private generateBakeFile(dt, suffix?: string): string {
|
||||
const bakeFile = path.join(ToolkitContext.tmpDir(), `docker-metadata-action-bake${suffix ? `-${suffix}` : ''}.json`);
|
||||
fs.writeFileSync(bakeFile, JSON.stringify({target: {[this.inputs.bakeTarget]: dt}}, null, 2));
|
||||
return bakeFile;
|
||||
}
|
||||
|
||||
@@ -533,4 +658,18 @@ export class Meta {
|
||||
private static sanitizeTag(tag: string): string {
|
||||
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
||||
}
|
||||
|
||||
private static shortSha(sha: string): string {
|
||||
let shortShaLength = defaultShortShaLength;
|
||||
if (process.env.DOCKER_METADATA_SHORT_SHA_LENGTH) {
|
||||
if (isNaN(Number(process.env.DOCKER_METADATA_SHORT_SHA_LENGTH))) {
|
||||
throw new Error(`DOCKER_METADATA_SHORT_SHA_LENGTH is not a valid number: ${process.env.DOCKER_METADATA_SHORT_SHA_LENGTH}`);
|
||||
}
|
||||
shortShaLength = Number(process.env.DOCKER_METADATA_SHORT_SHA_LENGTH);
|
||||
}
|
||||
if (shortShaLength >= sha.length) {
|
||||
return sha;
|
||||
}
|
||||
return sha.substring(0, shortShaLength);
|
||||
}
|
||||
}
|
||||
+5
-2
@@ -104,10 +104,10 @@ export function Parse(s: string): Tag {
|
||||
const value = parts[1];
|
||||
switch (key) {
|
||||
case 'type': {
|
||||
if (!Object.values(Type).includes(value)) {
|
||||
if (!Object.values(Type).includes(value as Type)) {
|
||||
throw new Error(`Unknown tag type attribute: ${value}`);
|
||||
}
|
||||
tag.type = value;
|
||||
tag.type = value as Type;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -137,6 +137,9 @@ export function Parse(s: string): Tag {
|
||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'value')) {
|
||||
tag.attrs['value'] = '';
|
||||
}
|
||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'match')) {
|
||||
tag.attrs['match'] = '';
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Type.Match: {
|
||||
|
||||
@@ -4,9 +4,11 @@ RUN apk add --no-cache coreutils jq
|
||||
ARG DOCKER_METADATA_OUTPUT_VERSION
|
||||
ARG DOCKER_METADATA_OUTPUT_TAGS
|
||||
ARG DOCKER_METADATA_OUTPUT_LABELS
|
||||
ARG DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||
ARG DOCKER_METADATA_OUTPUT_JSON
|
||||
RUN printenv DOCKER_METADATA_OUTPUT_VERSION
|
||||
RUN printenv DOCKER_METADATA_OUTPUT_TAGS
|
||||
RUN printenv DOCKER_METADATA_OUTPUT_LABELS
|
||||
RUN printenv DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||
RUN printenv DOCKER_METADATA_OUTPUT_JSON
|
||||
RUN echo $DOCKER_METADATA_OUTPUT_JSON | jq
|
||||
+4
-9
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
@@ -12,11 +11,7 @@
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": [
|
||||
"./__mocks__/**/*",
|
||||
"./__tests__/**/*",
|
||||
"./lib/**/*",
|
||||
"node_modules",
|
||||
"jest.config.ts"
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import {defineConfig} from 'vitest/config';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
clearMocks: true,
|
||||
environment: 'node',
|
||||
setupFiles: ['./__tests__/setup.unit.ts'],
|
||||
include: ['**/*.test.ts'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['clover'],
|
||||
include: ['src/**/*.ts'],
|
||||
exclude: ['src/**/main.ts']
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user