mirror of
https://github.com/docker/metadata-action.git
synced 2025-12-06 17:06:46 +03:00
Compare commits
413 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
818d4b7b91 | ||
|
|
948134af5e | ||
|
|
ef7eee951a | ||
|
|
8ec80c3be6 | ||
|
|
38650bbf6b | ||
|
|
ebbd9b4df7 | ||
|
|
2dadb92b6b | ||
|
|
2c0bd771b4 | ||
|
|
b10b364e15 | ||
|
|
40a1c6ff52 | ||
|
|
be8ea87c5a | ||
|
|
dbbf01822b | ||
|
|
72b4ec2b60 | ||
|
|
00e2c9d34e | ||
|
|
c4ee3adeed | ||
|
|
3bea1eeada | ||
|
|
88c7f0d3f6 | ||
|
|
101f9cbeaf | ||
|
|
0e44559303 | ||
|
|
517f8b0c3b | ||
|
|
bfaa9197f7 | ||
|
|
16dbdc96f6 | ||
|
|
bf095b87d3 | ||
|
|
2ed3c45f27 | ||
|
|
5076359ba6 | ||
|
|
d8f57c18fa | ||
|
|
80530e08c5 | ||
|
|
da933fb889 | ||
|
|
3f6690a76c | ||
|
|
dda839d15b | ||
|
|
37f1d84442 | ||
|
|
1ce942256d | ||
|
|
8f8c795666 | ||
|
|
9ec57ed1fc | ||
|
|
2bdac1078b | ||
|
|
9e02960866 | ||
|
|
ea910e3ad4 | ||
|
|
8b6629002b | ||
|
|
1db8e21e35 | ||
|
|
b30cff8c11 | ||
|
|
916b4b90e3 | ||
|
|
0ef9f130fa | ||
|
|
f5c49ece12 | ||
|
|
18df8a69c4 | ||
|
|
3343011071 | ||
|
|
0524f79273 | ||
|
|
b5c378621c | ||
|
|
a103499e09 | ||
|
|
766400ca14 | ||
|
|
e2ffd4cc94 | ||
|
|
6c3ca5dfa6 | ||
|
|
235becadd8 | ||
|
|
507c2f2dc5 | ||
|
|
04861f5102 | ||
|
|
6729545cde | ||
|
|
05d22bf317 | ||
|
|
70b403b46b | ||
|
|
9e6ae02878 | ||
|
|
3d239e8b8a | ||
|
|
7cb52e2750 | ||
|
|
90a1d5cf21 | ||
|
|
c98ac5e987 | ||
|
|
44d853bc0a | ||
|
|
d1abf80723 | ||
|
|
3358a27538 | ||
|
|
314ddf6d4a | ||
|
|
b91e8f52b0 | ||
|
|
fbac5f9bca | ||
|
|
57396166ad | ||
|
|
473bdc561c | ||
|
|
ebedea2c18 | ||
|
|
d00b20e38f | ||
|
|
a99e71cdc7 | ||
|
|
12cce9efe0 | ||
|
|
f17e188860 | ||
|
|
210d783f42 | ||
|
|
5f26473e44 | ||
|
|
49e79e3532 | ||
|
|
5ebec4fd21 | ||
|
|
8ed470c7f1 | ||
|
|
61ddee1921 | ||
|
|
8671a4f8ec | ||
|
|
3862a1b70f | ||
|
|
f7c31b1e79 | ||
|
|
55b0d953e7 | ||
|
|
4c6a2cafd0 | ||
|
|
6c51f019f8 | ||
|
|
5c9aa83b20 | ||
|
|
30af4d7327 | ||
|
|
594a555a35 | ||
|
|
7fa87ab51a | ||
|
|
02d1a10cce | ||
|
|
58061722cc | ||
|
|
1c9aacf050 | ||
|
|
1f87faac28 | ||
|
|
59bc9ddfd5 | ||
|
|
286660a061 | ||
|
|
139c7584e2 | ||
|
|
ee266832e5 | ||
|
|
ae052be62f | ||
|
|
98045504c7 | ||
|
|
97c170d70b | ||
|
|
44ecceaf69 | ||
|
|
e4d14b2070 | ||
|
|
f66710ef6c | ||
|
|
d6cc766711 | ||
|
|
9c37b1c855 | ||
|
|
e518b0e7bb | ||
|
|
7bf589e898 | ||
|
|
bc6cb60a8a | ||
|
|
4db6eea5ea | ||
|
|
b5ee2f25f6 | ||
|
|
8d56fe93cf | ||
|
|
59267481d9 |
@ -1,2 +1,12 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/node_modules
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
|
|||||||
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/dist/**
|
||||||
|
/coverage/**
|
||||||
|
/node_modules/**
|
||||||
@ -1,18 +1,19 @@
|
|||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es2021": true,
|
"es6": true,
|
||||||
"jest/globals": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:jest/recommended",
|
"plugin:jest/recommended",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended"
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": "latest",
|
"ecmaVersion": 2023,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
|||||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,3 +1,5 @@
|
|||||||
|
/.yarn/releases/** binary
|
||||||
|
/.yarn/plugins/** binary
|
||||||
/__tests__/fixtures/** -linguist-detectable
|
/__tests__/fixtures/** -linguist-detectable
|
||||||
/dist/** linguist-generated=true
|
/dist/** linguist-generated=true
|
||||||
/lib/** linguist-generated=true
|
/lib/** linguist-generated=true
|
||||||
|
|||||||
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -1 +0,0 @@
|
|||||||
* @crazy-max
|
|
||||||
3
.github/CODE_OF_CONDUCT.md
vendored
Normal file
3
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Code of conduct
|
||||||
|
|
||||||
|
- [Moby community guidelines](https://github.com/moby/moby/blob/master/CONTRIBUTING.md#moby-community-guidelines)
|
||||||
101
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
101
.github/ISSUE_TEMPLATE/bug.yml
vendored
Normal file
@ -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.
|
||||||
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -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.
|
|
||||||
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
9
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -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.
|
||||||
15
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
15
.github/ISSUE_TEMPLATE/feature.yml
vendored
Normal file
@ -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
|
||||||
12
.github/SECURITY.md
vendored
Normal file
12
.github/SECURITY.md
vendored
Normal file
@ -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.
|
||||||
32
.github/SUPPORT.md
vendored
32
.github/SUPPORT.md
vendored
@ -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.
|
|
||||||
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@ -11,6 +11,7 @@ updates:
|
|||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "daily"
|
interval: "daily"
|
||||||
|
versioning-strategy: "increase"
|
||||||
allow:
|
allow:
|
||||||
- dependency-type: "production"
|
- dependency-type: "production"
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
384
.github/workflows/ci.yml
vendored
384
.github/workflows/ci.yml
vendored
@ -1,8 +1,12 @@
|
|||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */4 * * *' # every 4 hours
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
@ -10,20 +14,42 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: localhost:5000/name/app
|
DOCKER_IMAGE: localhost:5000/name/app
|
||||||
|
BUILDX_VERSION: latest
|
||||||
|
|
||||||
jobs:
|
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:
|
multi-images:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -37,6 +63,9 @@ jobs:
|
|||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=sha
|
type=sha
|
||||||
|
-
|
||||||
|
name: Print envs
|
||||||
|
run: env|sort
|
||||||
|
|
||||||
tag-schedule:
|
tag-schedule:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -51,7 +80,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -81,7 +116,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -109,7 +150,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -134,7 +181,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -151,7 +204,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -161,12 +220,18 @@ jobs:
|
|||||||
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
||||||
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
|
||||||
labels:
|
custom-labels-annotations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -179,13 +244,24 @@ jobs:
|
|||||||
org.opencontainers.image.title=MyCustomTitle
|
org.opencontainers.image.title=MyCustomTitle
|
||||||
org.opencontainers.image.description=this is a "good" example
|
org.opencontainers.image.description=this is a "good" example
|
||||||
org.opencontainers.image.vendor=MyCompany
|
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:
|
global-exps:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@ -193,6 +269,8 @@ jobs:
|
|||||||
images: |
|
images: |
|
||||||
${{ env.DOCKER_IMAGE }}
|
${{ env.DOCKER_IMAGE }}
|
||||||
ghcr.io/name/app
|
ghcr.io/name/app
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
||||||
tags: |
|
tags: |
|
||||||
type=sha
|
type=sha
|
||||||
type=raw,value=gexp-branch-{{branch}}
|
type=raw,value=gexp-branch-{{branch}}
|
||||||
@ -200,13 +278,20 @@ jobs:
|
|||||||
type=raw,value=gexp-tag-{{tag}}
|
type=raw,value=gexp-tag-{{tag}}
|
||||||
type=raw,value=gexp-baseref-{{base_ref}}
|
type=raw,value=gexp-baseref-{{base_ref}}
|
||||||
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
||||||
|
type=raw,value=gexp-notdefbranch,enable={{is_not_default_branch}}
|
||||||
|
|
||||||
json:
|
json:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@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
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@ -235,7 +320,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
@ -252,17 +343,9 @@ jobs:
|
|||||||
type=semver,pattern=v{{major}}.{{minor}}
|
type=semver,pattern=v{{major}}.{{minor}}
|
||||||
type=semver,pattern=v{{major}}
|
type=semver,pattern=v{{major}}
|
||||||
type=sha
|
type=sha
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
-
|
-
|
||||||
name: Build and push to local registry
|
name: Build and push to local registry
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./test
|
context: ./test
|
||||||
file: ./test/Dockerfile
|
file: ./test/Dockerfile
|
||||||
@ -279,17 +362,18 @@ jobs:
|
|||||||
name: Check manifest
|
name: Check manifest
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v1
|
|
||||||
|
|
||||||
bake:
|
bake:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
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
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
@ -307,18 +391,244 @@ jobs:
|
|||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
type=sha
|
type=sha
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v1
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v1
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./test/docker-bake.hcl
|
./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: |
|
targets: |
|
||||||
release
|
release
|
||||||
|
|
||||||
|
sep-tags:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
sep:
|
||||||
|
- " "
|
||||||
|
- ","
|
||||||
|
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
|
||||||
|
id: meta
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.DOCKER_IMAGE }}
|
||||||
|
ghcr.io/name/app
|
||||||
|
sep-tags: ${{ matrix.sep }}
|
||||||
|
-
|
||||||
|
name: Tags
|
||||||
|
uses: actions/github-script@v8
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||||
|
|
||||||
|
output-env:
|
||||||
|
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
|
||||||
|
id: meta
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.DOCKER_IMAGE }}
|
||||||
|
ghcr.io/name/app
|
||||||
|
labels: |
|
||||||
|
maintainer=CrazyMax
|
||||||
|
annotations: |
|
||||||
|
maintainer=Foo
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: ./test
|
||||||
|
file: ./test/output.Dockerfile
|
||||||
|
build-args: |
|
||||||
|
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
|
||||||
|
|||||||
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
@ -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
|
||||||
21
.github/workflows/publish.yml
vendored
Normal file
21
.github/workflows/publish.yml
vendored
Normal file
@ -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
|
||||||
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@ -1,14 +1,15 @@
|
|||||||
name: test
|
name: test
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'releases/v*'
|
- 'releases/v*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/v*'
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
@ -16,19 +17,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v6
|
||||||
-
|
|
||||||
name: Validate
|
|
||||||
uses: docker/bake-action@v1
|
|
||||||
with:
|
|
||||||
targets: validate
|
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v1
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
files: ./coverage/clover.xml
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
43
.github/workflows/validate.yml
vendored
Normal file
43
.github/workflows/validate.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: validate
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'releases/v*'
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
targets: ${{ steps.generate.outputs.targets }}
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
-
|
||||||
|
name: List targets
|
||||||
|
id: generate
|
||||||
|
uses: docker/bake-action/subaction/list-targets@v6
|
||||||
|
with:
|
||||||
|
target: validate
|
||||||
|
|
||||||
|
validate:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- prepare
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Validate
|
||||||
|
uses: docker/bake-action@v6
|
||||||
|
with:
|
||||||
|
targets: ${{ matrix.target }}
|
||||||
71
.gitignore
vendored
71
.gitignore
vendored
@ -1,12 +1,5 @@
|
|||||||
/.dev
|
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
node_modules/
|
|
||||||
lib
|
|
||||||
|
|
||||||
# Jetbrains
|
|
||||||
/.idea
|
|
||||||
/*.iml
|
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@ -14,6 +7,7 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
@ -24,34 +18,14 @@ pids
|
|||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage
|
||||||
*.lcov
|
*.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
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
# TypeScript cache
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
@ -61,36 +35,19 @@ typings/
|
|||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
# dotenv environment variable files
|
||||||
.env
|
.env
|
||||||
.env.test
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# yarn v2
|
||||||
.cache
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
# next.js build output
|
.yarn/build-state.yml
|
||||||
.next
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
|||||||
6
.prettierignore
Normal file
6
.prettierignore
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/
|
||||||
17
.yarnrc.yml
Normal file
17
.yarnrc.yml
Normal file
@ -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
|
||||||
464
README.md
464
README.md
@ -1,12 +1,14 @@
|
|||||||
[](https://github.com/docker/metadata-action/releases/latest)
|
[](https://github.com/docker/metadata-action/releases/latest)
|
||||||
[](https://github.com/marketplace/actions/docker-metadata-action)
|
[](https://github.com/marketplace/actions/docker-metadata-action)
|
||||||
[](https://github.com/docker/metadata-action/actions?workflow=test)
|
[](https://github.com/docker/metadata-action/actions?workflow=ci)
|
||||||
|
[](https://github.com/docker/metadata-action/actions?workflow=test)
|
||||||
[](https://codecov.io/gh/docker/metadata-action)
|
[](https://codecov.io/gh/docker/metadata-action)
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
GitHub Action to extract metadata from Git reference and GitHub events.
|
GitHub Action to extract metadata from Git reference and GitHub events. This action
|
||||||
This action is particularly useful if used with [Docker Build Push](https://github.com/docker/build-push-action) action to tag and label Docker images.
|
is particularly useful if used with [Docker Build Push](https://github.com/docker/build-push-action)
|
||||||
|
action to tag and label Docker images.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -19,6 +21,8 @@ ___
|
|||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [outputs](#outputs)
|
* [outputs](#outputs)
|
||||||
|
* [environment variables](#environment-variables)
|
||||||
|
* [`context` input](#context-input)
|
||||||
* [`images` input](#images-input)
|
* [`images` input](#images-input)
|
||||||
* [`flavor` input](#flavor-input)
|
* [`flavor` input](#flavor-input)
|
||||||
* [`tags` input](#tags-input)
|
* [`tags` input](#tags-input)
|
||||||
@ -33,17 +37,21 @@ ___
|
|||||||
* [Notes](#notes)
|
* [Notes](#notes)
|
||||||
* [Image name and tag sanitization](#image-name-and-tag-sanitization)
|
* [Image name and tag sanitization](#image-name-and-tag-sanitization)
|
||||||
* [Latest tag](#latest-tag)
|
* [Latest tag](#latest-tag)
|
||||||
|
* [`priority` attribute](#priority-attribute)
|
||||||
* [Global expressions](#global-expressions)
|
* [Global expressions](#global-expressions)
|
||||||
* [`{{branch}}`](#branch)
|
* [`{{branch}}`](#branch)
|
||||||
* [`{{tag}}`](#tag)
|
* [`{{tag}}`](#tag)
|
||||||
* [`{{sha}}`](#sha)
|
* [`{{sha}}`](#sha)
|
||||||
* [`{{base_ref}}`](#base_ref)
|
* [`{{base_ref}}`](#base_ref)
|
||||||
* [`{{is_default_branch}}`](#is_default_branch)
|
* [`{{is_default_branch}}`](#is_default_branch)
|
||||||
* [`{{date '<format>'}}`](#date-format)
|
* [`{{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)
|
* [Major version zero](#major-version-zero)
|
||||||
* [JSON output object](#json-output-object)
|
* [JSON output object](#json-output-object)
|
||||||
* [Overwrite labels](#overwrite-labels)
|
* [Overwrite labels and annotations](#overwrite-labels-and-annotations)
|
||||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
* [Annotations](#annotations)
|
||||||
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@ -53,6 +61,7 @@ ___
|
|||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
@ -68,23 +77,23 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: name/app
|
images: name/app
|
||||||
-
|
-
|
||||||
name: Login to DockerHub
|
name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
@ -93,12 +102,13 @@ jobs:
|
|||||||
```
|
```
|
||||||
|
|
||||||
| Event | Ref | Docker Tags |
|
| Event | Ref | Docker Tags |
|
||||||
|-----------------|-------------------------------|-------------------------------------|
|
|---------------------|-------------------------------|----------------------------|
|
||||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||||
| `push` | `refs/heads/master` | `master` |
|
| `push` | `refs/heads/master` | `master` |
|
||||||
| `push` | `refs/heads/releases/v1` | `releases-v1` |
|
| `push` | `refs/heads/releases/v1` | `releases-v1` |
|
||||||
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3`, `latest` |
|
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3`, `latest` |
|
||||||
| `push tag` | `refs/tags/v2.0.8-beta.67` | `v2.0.8-beta.67`, `latest` |
|
| `push tag` | `refs/tags/v2.0.8-beta.67` | `v2.0.8-beta.67`, `latest` |
|
||||||
|
| `workflow_dispatch` | `refs/heads/master` | `master` |
|
||||||
|
|
||||||
### Semver
|
### Semver
|
||||||
|
|
||||||
@ -121,11 +131,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
name/app
|
name/app
|
||||||
@ -137,13 +147,13 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Login to DockerHub
|
name: Login to DockerHub
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
@ -162,8 +172,8 @@ jobs:
|
|||||||
### Bake definition
|
### Bake definition
|
||||||
|
|
||||||
This action also handles a bake definition file that can be used with the
|
This action also handles a bake definition file that can be used with the
|
||||||
[Docker Bake action](https://github.com/docker/bake-action). You just have to declare an empty target named
|
[Docker Bake action](https://github.com/docker/bake-action). You just have to
|
||||||
`docker-metadata-action` and inherit from it.
|
declare an empty target named `docker-metadata-action` and inherit from it.
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
// docker-bake.hcl
|
// docker-bake.hcl
|
||||||
@ -197,13 +207,10 @@ jobs:
|
|||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
name/app
|
name/app
|
||||||
@ -215,15 +222,16 @@ jobs:
|
|||||||
type=sha
|
type=sha
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v1
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
${{ steps.meta.outputs.bake-file }}
|
cwd://${{ steps.meta.outputs.bake-file }}
|
||||||
targets: build
|
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
|
```json
|
||||||
{
|
{
|
||||||
@ -254,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
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### 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
|
> `List` type is a newline-delimited string
|
||||||
> ```yaml
|
> ```yaml
|
||||||
> labels: |
|
> labels: |
|
||||||
@ -269,26 +294,76 @@ Following inputs can be used as `step.with` keys
|
|||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Type | Description |
|
| 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 |
|
| `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 |
|
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||||
| `labels` | List | List of custom labels |
|
| `labels` | List | List of custom labels |
|
||||||
|
| `annotations` | List | List of custom annotations |
|
||||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||||
| `sep-labels` | String | Separator to use for labels 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`) |
|
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
Following outputs are available
|
The following outputs are available:
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|---------------|---------|-------------------------------------------------------------------------------|
|
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `version` | String | Docker image version |
|
| `version` | String | Docker image version |
|
||||||
| `tags` | String | Docker tags |
|
| `tags` | String | Docker tags |
|
||||||
|
| `tag-names` | String | Docker tag names without image base name |
|
||||||
| `labels` | String | Docker labels |
|
| `labels` | String | Docker labels |
|
||||||
|
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||||
| `json` | String | JSON output of tags and labels |
|
| `json` | String | JSON output of tags and labels |
|
||||||
| `bake-file` | File | [Bake definition file](https://github.com/docker/buildx#file-definition) path |
|
| `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 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_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@v6
|
||||||
|
with:
|
||||||
|
build-args: |
|
||||||
|
DOCKER_METADATA_OUTPUT_JSON
|
||||||
|
```
|
||||||
|
|
||||||
|
### 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 |
|
||||||
|
| `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
|
||||||
|
|
||||||
|
`context` defines where to get context metadata:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
# default
|
||||||
|
context: workflow
|
||||||
|
# or
|
||||||
|
context: git
|
||||||
|
```
|
||||||
|
|
||||||
|
* `workflow`: Get context metadata from the workflow (GitHub context). See https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
|
||||||
|
* `git`: Get context metadata from the workflow and overrides some of them with current Git context, such as `ref` and `sha`.
|
||||||
|
|
||||||
## `images` input
|
## `images` input
|
||||||
|
|
||||||
@ -313,6 +388,8 @@ images: |
|
|||||||
* `name=<string>` image base name
|
* `name=<string>` image base name
|
||||||
* `enable=<true|false>` enable this entry (default `true`)
|
* `enable=<true|false>` enable this entry (default `true`)
|
||||||
|
|
||||||
|
If `images` is empty, tags will be generated without base name.
|
||||||
|
|
||||||
## `flavor` input
|
## `flavor` input
|
||||||
|
|
||||||
`flavor` defines a global behavior for [`tags`](#tags-input):
|
`flavor` defines a global behavior for [`tags`](#tags-input):
|
||||||
@ -325,13 +402,16 @@ flavor: |
|
|||||||
```
|
```
|
||||||
|
|
||||||
* `latest=<auto|true|false>`: Handle [latest tag](#latest-tag) (default `auto`)
|
* `latest=<auto|true|false>`: Handle [latest tag](#latest-tag) (default `auto`)
|
||||||
* `prefix=<string>,onlatest=<true|false>`: A global prefix for each generated tag and optionally for `latest`
|
* `prefix=<string>,onlatest=<true|false>`: A global prefix for each generated
|
||||||
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated tag and optionally for `latest`
|
tag and optionally for `latest`
|
||||||
|
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated
|
||||||
|
tag and optionally for `latest`
|
||||||
|
|
||||||
## `tags` input
|
## `tags` input
|
||||||
|
|
||||||
`tags` is the core input of this action as everything related to it will reflect the output metadata. This one is in
|
`tags` is the core input of this action as everything related to it will
|
||||||
the form of a key-value pair list in CSV format to remove limitations intrinsically linked to GitHub Actions
|
reflect the output metadata. This one is in the form of a key-value pair list
|
||||||
|
in CSV format to remove limitations intrinsically linked to GitHub Actions
|
||||||
(only string format is handled in the input fields). Here is an example:
|
(only string format is handled in the input fields). Here is an example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -359,7 +439,7 @@ Each entry is defined by a `type`, which are:
|
|||||||
And global attributes:
|
And global attributes:
|
||||||
|
|
||||||
* `enable=<true|false>` enable this entry (default `true`)
|
* `enable=<true|false>` enable this entry (default `true`)
|
||||||
* `priority=<number>` priority to manage the order of tags
|
* `priority=<number>` set tag [priority](#priority-attribute) order
|
||||||
* `prefix=<string>` add prefix
|
* `prefix=<string>` add prefix
|
||||||
* `suffix=<string>` add suffix
|
* `suffix=<string>` add suffix
|
||||||
|
|
||||||
@ -383,18 +463,23 @@ tags: |
|
|||||||
type=schedule,pattern=nightly
|
type=schedule,pattern=nightly
|
||||||
# handlebars
|
# handlebars
|
||||||
type=schedule,pattern={{date 'YYYYMMDD'}}
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
||||||
|
# handlebars with timezone
|
||||||
|
type=schedule,pattern={{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on [schedule event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule).
|
Will be used on [schedule event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule).
|
||||||
|
|
||||||
`pattern` is a specially crafted attribute to support [Handlebars' template](https://handlebarsjs.com/guide/) with
|
`pattern` is a specially crafted attribute to support [Handlebars' template](https://handlebarsjs.com/guide/)
|
||||||
the following expressions:
|
with the following expressions:
|
||||||
* `date 'format'` ; render date by its [moment format](https://momentjs.com/docs/#/displaying/format/)
|
|
||||||
|
* `date 'format' tz='Timezone'` ; render date by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||||
|
Default `tz` is UTC.
|
||||||
|
|
||||||
| Pattern | Output |
|
| Pattern | Output |
|
||||||
|--------------------------|----------------------|
|
|----------------------------------------------|-------------------|
|
||||||
| `nightly` | `nightly` |
|
| `nightly` | `nightly` |
|
||||||
| `{{date 'YYYYMMDD'}}` | `20210326` |
|
| `{{date 'YYYYMMDD'}}` | `20200110` |
|
||||||
|
| `{{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||||
|
|
||||||
Extended attributes and default values:
|
Extended attributes and default values:
|
||||||
|
|
||||||
@ -411,40 +496,48 @@ tags: |
|
|||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
# use custom value instead of git tag
|
# use custom value instead of git tag
|
||||||
type=semver,pattern={{version}},value=v1.0.0
|
type=semver,pattern={{version}},value=v1.0.0
|
||||||
|
# use custom value and match part of it
|
||||||
|
type=semver,pattern={{version}},value=p1/v1.0.0,match=v(\d.\d.\d)$
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
|
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||||
and requires a valid [semver](https://semver.org/) Git tag, but you can also use a custom value through `value`
|
and requires a valid [semver](https://semver.org/) Git tag, but you can also
|
||||||
attribute.
|
use a custom value through `value` attribute.
|
||||||
|
|
||||||
|
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/)
|
||||||
|
with the following expressions:
|
||||||
|
|
||||||
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
|
|
||||||
* `raw` ; the actual tag
|
* `raw` ; the actual tag
|
||||||
* `version` ; shorthand for `{{major}}.{{minor}}.{{patch}}` (can include pre-release)
|
* `version` ; shorthand for `{{major}}.{{minor}}.{{patch}}` (can include pre-release)
|
||||||
* `major` ; major version identifier
|
* `major` ; major version identifier
|
||||||
* `minor` ; minor version identifier
|
* `minor` ; minor version identifier
|
||||||
* `patch` ; patch version identifier
|
* `patch` ; patch version identifier
|
||||||
|
|
||||||
| Git tag | Pattern | Output |
|
| Git tag | Pattern | Match | Output |
|
||||||
|--------------------|----------------------------------------------------------|----------------------|
|
|------------------|-----------------------|----------------|------------------|
|
||||||
| `v1.2.3` | `{{raw}}` | `v1.2.3` |
|
| `v1.2.3` | `{{raw}}` | | `v1.2.3` |
|
||||||
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
||||||
| `v1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
| `v1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
||||||
| `v1.2.3` | `v{{major}}` | `v1` |
|
| `v1.2.3` | `v{{major}}` | | `v1` |
|
||||||
| `v1.2.3` | `{{minor}}` | `2` |
|
| `v1.2.3` | `{{minor}}` | | `2` |
|
||||||
| `v1.2.3` | `{{patch}}` | `3` |
|
| `v1.2.3` | `{{patch}}` | | `3` |
|
||||||
| `v2.0.8-beta.67` | `{{raw}}` | `v2.0.8-beta.67` |
|
| `p1/v1.2.3` | `{{version}}` | `v(\d.\d.\d)$` | `1.2.3` |
|
||||||
| `v2.0.8-beta.67` | `{{version}}` | `2.0.8-beta.67` |
|
| `v2.0.8-beta.67` | `{{raw}}` | | `v2.0.8-beta.67` |
|
||||||
| `v2.0.8-beta.67` | `{{major}}.{{minor}}` | `2.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`* |
|
||||||
|
|
||||||
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}` if specified) as tag
|
> [!IMPORTANT]
|
||||||
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
|
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}`
|
||||||
> not yet fit for public consumption.
|
> 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
|
||||||
|
> consumption.
|
||||||
|
|
||||||
Extended attributes and default values:
|
Extended attributes and default values:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
tags: |
|
tags: |
|
||||||
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=
|
type=semver,enable=true,priority=900,prefix=,suffix=,pattern=,value=,match=
|
||||||
```
|
```
|
||||||
|
|
||||||
### `type=pep440`
|
### `type=pep440`
|
||||||
@ -455,36 +548,43 @@ tags: |
|
|||||||
type=pep440,pattern={{version}}
|
type=pep440,pattern={{version}}
|
||||||
# use custom value instead of git tag
|
# use custom value instead of git tag
|
||||||
type=pep440,pattern={{version}},value=1.0.0
|
type=pep440,pattern={{version}},value=1.0.0
|
||||||
|
# use custom value and match part of it
|
||||||
|
type=pep440,pattern={{version}},value=p1/v1.0.0,match=v(\d.\d.\d)$
|
||||||
```
|
```
|
||||||
|
|
||||||
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push)
|
Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||||
and requires a Git tag that conforms to [PEP 440](https://www.python.org/dev/peps/pep-0440/), but you can also use a
|
and requires a Git tag that conforms to [PEP 440](https://www.python.org/dev/peps/pep-0440/),
|
||||||
custom value through `value` attribute.
|
but you can also use a custom value through `value` attribute.
|
||||||
|
|
||||||
|
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/)
|
||||||
|
with the following expressions:
|
||||||
|
|
||||||
`pattern` attribute supports [Handlebars template](https://handlebarsjs.com/guide/) with the following expressions:
|
|
||||||
* `raw` ; the actual tag
|
* `raw` ; the actual tag
|
||||||
* `version` ; cleaned version
|
* `version` ; cleaned version
|
||||||
* `major` ; major version identifier
|
* `major` ; major version identifier
|
||||||
* `minor` ; minor version identifier
|
* `minor` ; minor version identifier
|
||||||
* `patch` ; patch version identifier
|
* `patch` ; patch version identifier
|
||||||
|
|
||||||
| Git tag | Pattern | Output |
|
| Git tag | Pattern | Match | Output |
|
||||||
|--------------------|----------------------------------------------------------|----------------------|
|
|--------------|-----------------------|----------------|----------------|
|
||||||
| `1.2.3` | `{{raw}}` | `1.2.3` |
|
| `1.2.3` | `{{raw}}` | | `1.2.3` |
|
||||||
| `1.2.3` | `{{version}}` | `1.2.3` |
|
| `1.2.3` | `{{version}}` | | `1.2.3` |
|
||||||
| `v1.2.3` | `{{version}}` | `1.2.3` |
|
| `v1.2.3` | `{{version}}` | | `1.2.3` |
|
||||||
| `1.2.3` | `{{major}}.{{minor}}` | `1.2` |
|
| `1.2.3` | `{{major}}.{{minor}}` | | `1.2` |
|
||||||
| `1.2.3` | `v{{major}}` | `v1` |
|
| `1.2.3` | `v{{major}}` | | `v1` |
|
||||||
| `v1.2.3rc2` | `{{raw}}` | `v1.2.3rc2` |
|
| `v1.2.3rc2` | `{{raw}}` | | `v1.2.3rc2` |
|
||||||
| `1.2.3rc2` | `{{version}}` | `1.2.3rc2` |
|
| `1.2.3rc2` | `{{version}}` | | `1.2.3rc2` |
|
||||||
| `1.2.3rc2` | `{{major}}.{{minor}}` | `1.2.3rc2`* |
|
| `p1/v1.2.3` | `{{version}}` | `v(\d.\d.\d)$` | `1.2.3` |
|
||||||
| `1.2.3post1` | `{{major}}.{{minor}}` | `1.2.3.post1`* |
|
| `1.2.3rc2` | `{{major}}.{{minor}}` | | `1.2.3rc2`* |
|
||||||
| `1.2.3beta2` | `{{major}}.{{minor}}` | `1.2.3b2`* |
|
| `1.2.3post1` | `{{major}}.{{minor}}` | | `1.2.3.post1`* |
|
||||||
| `1.0dev4` | `{{major}}.{{minor}}` | `1.0.dev4`* |
|
| `1.2.3beta2` | `{{major}}.{{minor}}` | | `1.2.3b2`* |
|
||||||
|
| `1.0dev4` | `{{major}}.{{minor}}` | | `1.0.dev4`* |
|
||||||
|
|
||||||
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if specified) as tag
|
> [!IMPORTANT]
|
||||||
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
|
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if
|
||||||
> not yet fit for public consumption.
|
> 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
|
||||||
|
> consumption.
|
||||||
|
|
||||||
Extended attributes and default values:
|
Extended attributes and default values:
|
||||||
|
|
||||||
@ -505,9 +605,9 @@ tags: |
|
|||||||
type=match,pattern=v(.*),group=1,value=v1.0.0
|
type=match,pattern=v(.*),group=1,value=v1.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Can create a regular expression for matching Git tag with a pattern and capturing group. Will be used on a
|
Can create a regular expression for matching Git tag with a pattern and
|
||||||
[push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push) but, you can also use
|
capturing group. Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||||
a custom value through `value` attribute.
|
but, you can also use a custom value through `value` attribute.
|
||||||
|
|
||||||
| Git tag | Pattern | Group | Output |
|
| Git tag | Pattern | Group | Output |
|
||||||
|-------------------------|------------------|---------|------------------------|
|
|-------------------------|------------------|---------|------------------------|
|
||||||
@ -534,9 +634,9 @@ tags: |
|
|||||||
type=edge,branch=main
|
type=edge,branch=main
|
||||||
```
|
```
|
||||||
|
|
||||||
An `edge` tag reflects the last commit of the active branch on your Git repository. I usually prefer to use `edge`
|
An `edge` tag reflects the last commit of the active branch on your Git
|
||||||
as a Docker tag for a better distinction or common pattern. This is also used by official images
|
repository. I usually prefer to use `edge` as a Docker tag for a better
|
||||||
like [Alpine](https://hub.docker.com/_/alpine).
|
distinction or common pattern. This is also used by official images like [Alpine](https://hub.docker.com/_/alpine).
|
||||||
|
|
||||||
Extended attributes and default values:
|
Extended attributes and default values:
|
||||||
|
|
||||||
@ -558,17 +658,19 @@ tags: |
|
|||||||
```
|
```
|
||||||
|
|
||||||
This type handles Git ref (or reference) for the following events:
|
This type handles Git ref (or reference) for the following events:
|
||||||
|
|
||||||
* `branch` ; eg. `refs/heads/master`
|
* `branch` ; eg. `refs/heads/master`
|
||||||
* `tag` ; eg. `refs/tags/v1.0.0`
|
* `tag` ; eg. `refs/tags/v1.0.0`
|
||||||
* `pr` ; eg. `refs/pull/318/merge`
|
* `pr` ; eg. `refs/pull/318/merge`
|
||||||
|
|
||||||
| Event | Ref | Output |
|
| Event | Ref | Output |
|
||||||
|-----------------|-------------------------------|-------------------------------|
|
|---------------------|-------------------------------|------------------|
|
||||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||||
| `push` | `refs/heads/master` | `master` |
|
| `push` | `refs/heads/master` | `master` |
|
||||||
| `push` | `refs/heads/my/branch` | `my-branch` |
|
| `push` | `refs/heads/my/branch` | `my-branch` |
|
||||||
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3` |
|
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3` |
|
||||||
| `push tag` | `refs/tags/v2.0.8-beta.67` | `v2.0.8-beta.67` |
|
| `push tag` | `refs/tags/v2.0.8-beta.67` | `v2.0.8-beta.67` |
|
||||||
|
| `workflow_dispatch` | `refs/heads/master` | `master` |
|
||||||
|
|
||||||
Extended attributes and default values:
|
Extended attributes and default values:
|
||||||
|
|
||||||
@ -615,7 +717,26 @@ tags: |
|
|||||||
type=sha,format=long
|
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:
|
Extended attributes and default values:
|
||||||
|
|
||||||
@ -628,7 +749,7 @@ tags: |
|
|||||||
|
|
||||||
### Image name and tag sanitization
|
### Image name and tag sanitization
|
||||||
|
|
||||||
In order to comply with [the specification](https://docs.docker.com/engine/reference/commandline/tag/#extended-description),
|
In order to comply with [the specification](https://docs.docker.com/engine/reference/commandline/tag/#description),
|
||||||
the image name components may contain lowercase letters, digits and separators.
|
the image name components may contain lowercase letters, digits and separators.
|
||||||
A separator is defined as a period, one or two underscores, or one or more
|
A separator is defined as a period, one or two underscores, or one or more
|
||||||
dashes. A name component may not start or end with a separator.
|
dashes. A name component may not start or end with a separator.
|
||||||
@ -644,9 +765,12 @@ To ease the integration in your workflow, this action will automatically:
|
|||||||
|
|
||||||
### Latest tag
|
### Latest tag
|
||||||
|
|
||||||
`latest` tag is handled through the [`flavor` input](#flavor-input). It will be generated by default (`auto` mode) for:
|
`latest` tag is handled through the [`flavor` input](#flavor-input). It will be
|
||||||
|
generated by default (`auto` mode) for:
|
||||||
|
|
||||||
* [`type=ref,event=tag`](#typeref)
|
* [`type=ref,event=tag`](#typeref)
|
||||||
* [`type=semver,pattern=...`](#typesemver)
|
* [`type=semver,pattern=...`](#typesemver)
|
||||||
|
* [`type=pep440,pattern=...`](#typepep440)
|
||||||
* [`type=match,pattern=...`](#typematch)
|
* [`type=match,pattern=...`](#typematch)
|
||||||
|
|
||||||
For conditionally tagging with latest for a specific branch name, e.g. if your
|
For conditionally tagging with latest for a specific branch name, e.g. if your
|
||||||
@ -667,10 +791,29 @@ tags: |
|
|||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `priority` attribute
|
||||||
|
|
||||||
|
`priority=<int>` attribute is used to sort tags in the final list. The higher
|
||||||
|
the value, the higher the priority. The first tag in the list (higher priority)
|
||||||
|
will be used as the image version for generated OCI label and [`version` output](#outputs).
|
||||||
|
Each tags `type` attribute has a default priority:
|
||||||
|
|
||||||
|
| Attribute | Default priority |
|
||||||
|
|------------|------------------|
|
||||||
|
| `schedule` | `1000` |
|
||||||
|
| `semver` | `900` |
|
||||||
|
| `pep440` | `900` |
|
||||||
|
| `match` | `800` |
|
||||||
|
| `edge` | `700` |
|
||||||
|
| `ref` | `600` |
|
||||||
|
| `raw` | `200` |
|
||||||
|
| `sha` | `100` |
|
||||||
|
|
||||||
### Global expressions
|
### Global expressions
|
||||||
|
|
||||||
The following [Handlebars' template](https://handlebarsjs.com/guide/) 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
|
```yaml
|
||||||
tags: |
|
tags: |
|
||||||
@ -680,13 +823,20 @@ tags: |
|
|||||||
type=raw,value=mytag-{{branch}}-{{sha}}
|
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}}`
|
#### `{{branch}}`
|
||||||
|
|
||||||
Returns the branch name that triggered the workflow run. Will be empty if not
|
Returns the branch name that triggered the workflow run. Will be empty if not
|
||||||
a branch reference:
|
a branch reference:
|
||||||
|
|
||||||
| Event | Ref | Output |
|
| Event | Ref | Output |
|
||||||
|-----------------|-------------------------------|---------------------|
|
|----------------|------------------------|-------------|
|
||||||
| `pull_request` | `refs/pull/2/merge` | |
|
| `pull_request` | `refs/pull/2/merge` | |
|
||||||
| `push` | `refs/heads/master` | `master` |
|
| `push` | `refs/heads/master` | `master` |
|
||||||
| `push` | `refs/heads/my/branch` | `my-branch` |
|
| `push` | `refs/heads/my/branch` | `my-branch` |
|
||||||
@ -720,6 +870,7 @@ workflow run. Will be empty for a branch reference:
|
|||||||
| `push` | `refs/heads/my/branch` | |
|
| `push` | `refs/heads/my/branch` | |
|
||||||
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
> *`base_ref` is available in the push payload but doesn't always seem to
|
> *`base_ref` is available in the push payload but doesn't always seem to
|
||||||
> return the expected branch when the push tag event occurs. It's also
|
> return the expected branch when the push tag event occurs. It's also
|
||||||
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
||||||
@ -731,22 +882,43 @@ workflow run. Will be empty for a branch reference:
|
|||||||
Returns `true` if the branch that triggered the workflow run is the default
|
Returns `true` if the branch that triggered the workflow run is the default
|
||||||
one, otherwise `false`.
|
one, otherwise `false`.
|
||||||
|
|
||||||
#### `{{date '<format>'}}`
|
#### `{{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/).
|
Returns the current date rendered by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||||
|
Default `tz` is UTC.
|
||||||
|
|
||||||
| Expression | Output example |
|
| Expression | Output example |
|
||||||
|--------------------------------------------|-----------------------------------------|
|
|----------------------------------------------|-----------------------------------------|
|
||||||
| `{{date 'YYYYMMDD'}}` | `20200110` |
|
| `{{date 'YYYYMMDD'}}` | `20200110` |
|
||||||
| `{{date 'dddd, MMMM Do YYYY, h:mm:ss a'}}` | `Friday, January 10th 2020, 3:25:50 pm` |
|
| `{{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
|
||||||
|
|
||||||
Major version zero (`0.y.z`) is for initial development and **may** change at any time. This means the public API
|
Major version zero (`0.y.z`) is for initial development and **may** change at
|
||||||
[**should not** be considered stable](https://semver.org/#spec-item-4).
|
any time. This means the public API [**should not** be considered stable](https://semver.org/#spec-item-4).
|
||||||
|
|
||||||
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver) with `{{major}}`
|
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver)
|
||||||
pattern. You can manage this behavior like this:
|
with `{{major}}` pattern. You can manage this behavior like this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# refs/tags/v0.1.2
|
# refs/tags/v0.1.2
|
||||||
@ -761,19 +933,19 @@ tags: |
|
|||||||
|
|
||||||
### JSON output object
|
### JSON output object
|
||||||
|
|
||||||
The `json` output is a JSON object composed of the generated tags and labels so that you can reuse them further in your
|
The `json` output is a JSON object composed of the generated tags and labels so
|
||||||
workflow using the [`fromJSON` function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson):
|
that you can reuse them further in your workflow using the [`fromJSON` function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
id: meta
|
id: meta
|
||||||
with:
|
with:
|
||||||
images: name/app
|
images: name/app
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@ -783,16 +955,17 @@ workflow using the [`fromJSON` function](https://docs.github.com/en/actions/lear
|
|||||||
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
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)
|
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
|
```yaml
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: name/app
|
images: name/app
|
||||||
labels: |
|
labels: |
|
||||||
@ -802,18 +975,79 @@ labels generated are not suitable, you can overwrite them like this:
|
|||||||
org.opencontainers.image.vendor=MyCompany
|
org.opencontainers.image.vendor=MyCompany
|
||||||
```
|
```
|
||||||
|
|
||||||
## Keep up-to-date with GitHub Dependabot
|
### Annotations
|
||||||
|
|
||||||
Since [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot)
|
Since Buildx 0.12, it is possible to set annotations to your image through the
|
||||||
has [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),
|
`--annotation` flag.
|
||||||
to enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:
|
|
||||||
|
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
|
```yaml
|
||||||
version: 2
|
-
|
||||||
updates:
|
name: Docker meta
|
||||||
# Maintain dependencies for GitHub Actions
|
uses: docker/metadata-action@v5
|
||||||
- package-ecosystem: "github-actions"
|
with:
|
||||||
directory: "/"
|
images: name/app
|
||||||
schedule:
|
-
|
||||||
interval: "daily"
|
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
|
||||||
|
this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
|
||||||
|
|||||||
299
UPGRADE.md
299
UPGRADE.md
@ -1,299 +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@v2
|
|
||||||
-
|
|
||||||
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@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
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@v2
|
|
||||||
-
|
|
||||||
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@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
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@v2
|
|
||||||
-
|
|
||||||
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@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
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@v2
|
|
||||||
-
|
|
||||||
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@v1
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
-
|
|
||||||
name: Build and push
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
```
|
|
||||||
223
__mocks__/@actions/github.ts
Normal file
223
__mocks__/@actions/github.ts
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
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(() => ({
|
||||||
|
rest: {
|
||||||
|
repos: {
|
||||||
|
getCommit: jest.fn(() =>
|
||||||
|
Promise.resolve({
|
||||||
|
data: {
|
||||||
|
commit: {
|
||||||
|
committer: {
|
||||||
|
date: '2024-11-13T13:42:28Z'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
@ -1,192 +1,141 @@
|
|||||||
import {beforeEach, describe, expect, it, jest} from '@jest/globals';
|
import {afterEach, beforeEach, describe, expect, test, it, jest} from '@jest/globals';
|
||||||
|
import * as dotenv from 'dotenv';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
|
||||||
import * as path from 'path';
|
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 {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||||
|
|
||||||
import * as context from '../src/context';
|
import {ContextSource, getContext, getInputs, Inputs} from '../src/context';
|
||||||
|
|
||||||
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
|
const toolkit = new Toolkit({githubToken: 'fake-github-token'});
|
||||||
const tmpDir = path.join('/tmp/.docker-metadata-action-jest').split(path.sep).join(path.posix.sep);
|
|
||||||
if (!fs.existsSync(tmpDir)) {
|
|
||||||
fs.mkdirSync(tmpDir, {recursive: true});
|
|
||||||
}
|
|
||||||
return tmpDir;
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getInputList', () => {
|
|
||||||
it('single line correctly', async () => {
|
|
||||||
await setInput('foo', 'bar');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline correctly', async () => {
|
|
||||||
setInput('foo', 'bar\nbaz');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('empty lines correctly', async () => {
|
|
||||||
setInput('foo', 'bar\n\nbaz');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('comment correctly', async () => {
|
|
||||||
setInput('foo', 'bar\n#com\n"#taken"\nhello#comment\nbaz');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', '#taken', 'hello', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('comma correctly', async () => {
|
|
||||||
setInput('foo', 'bar,baz');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('empty result correctly', async () => {
|
|
||||||
setInput('foo', 'bar,baz,');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('different new lines correctly', async () => {
|
|
||||||
setInput('foo', 'bar\r\nbaz');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('different new lines and comma correctly', async () => {
|
|
||||||
setInput('foo', 'bar\r\nbaz,bat');
|
|
||||||
const res = context.getInputList('foo');
|
|
||||||
expect(res).toEqual(['bar', 'baz', 'bat']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline and ignoring comma correctly', async () => {
|
|
||||||
setInput('cache-from', 'user/app:cache\ntype=local,src=path/to/dir');
|
|
||||||
const res = context.getInputList('cache-from', true);
|
|
||||||
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('different new lines and ignoring comma correctly', async () => {
|
|
||||||
setInput('cache-from', 'user/app:cache\r\ntype=local,src=path/to/dir');
|
|
||||||
const res = context.getInputList('cache-from', true);
|
|
||||||
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline values', async () => {
|
|
||||||
setInput(
|
|
||||||
'secrets',
|
|
||||||
`GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789
|
|
||||||
"MYSECRET=aaaaaaaa
|
|
||||||
bbbbbbb
|
|
||||||
ccccccccc"
|
|
||||||
FOO=bar`
|
|
||||||
);
|
|
||||||
const res = context.getInputList('secrets', true);
|
|
||||||
expect(res).toEqual([
|
|
||||||
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
|
|
||||||
`MYSECRET=aaaaaaaa
|
|
||||||
bbbbbbb
|
|
||||||
ccccccccc`,
|
|
||||||
'FOO=bar'
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline values with empty lines', async () => {
|
|
||||||
setInput(
|
|
||||||
'secrets',
|
|
||||||
`GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789
|
|
||||||
"MYSECRET=aaaaaaaa
|
|
||||||
bbbbbbb
|
|
||||||
ccccccccc"
|
|
||||||
FOO=bar
|
|
||||||
"EMPTYLINE=aaaa
|
|
||||||
|
|
||||||
bbbb
|
|
||||||
ccc"`
|
|
||||||
);
|
|
||||||
const res = context.getInputList('secrets', true);
|
|
||||||
expect(res).toEqual([
|
|
||||||
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
|
|
||||||
`MYSECRET=aaaaaaaa
|
|
||||||
bbbbbbb
|
|
||||||
ccccccccc`,
|
|
||||||
'FOO=bar',
|
|
||||||
`EMPTYLINE=aaaa
|
|
||||||
|
|
||||||
bbbb
|
|
||||||
ccc`
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline values without quotes', async () => {
|
|
||||||
setInput(
|
|
||||||
'secrets',
|
|
||||||
`GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789
|
|
||||||
MYSECRET=aaaaaaaa
|
|
||||||
bbbbbbb
|
|
||||||
ccccccccc
|
|
||||||
FOO=bar`
|
|
||||||
);
|
|
||||||
const res = context.getInputList('secrets', true);
|
|
||||||
expect(res).toEqual(['GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'MYSECRET=aaaaaaaa', 'bbbbbbb', 'ccccccccc', 'FOO=bar']);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('multiline values escape quotes', async () => {
|
|
||||||
setInput(
|
|
||||||
'secrets',
|
|
||||||
`GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789
|
|
||||||
"MYSECRET=aaaaaaaa
|
|
||||||
bbbb""bbb
|
|
||||||
ccccccccc"
|
|
||||||
FOO=bar`
|
|
||||||
);
|
|
||||||
const res = context.getInputList('secrets', true);
|
|
||||||
expect(res).toEqual([
|
|
||||||
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
|
|
||||||
`MYSECRET=aaaaaaaa
|
|
||||||
bbbb"bbb
|
|
||||||
ccccccccc`,
|
|
||||||
'FOO=bar'
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('asyncForEach', () => {
|
|
||||||
it('executes async tasks sequentially', async () => {
|
|
||||||
const testValues = [1, 2, 3, 4, 5];
|
|
||||||
const results: number[] = [];
|
|
||||||
|
|
||||||
await context.asyncForEach(testValues, async value => {
|
|
||||||
results.push(value);
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(results).toEqual(testValues);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('setOutput', () => {
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
process.stdout.write = jest.fn() as typeof process.stdout.write;
|
jest.clearAllMocks();
|
||||||
|
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
|
||||||
|
return new Context();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
describe('getInputs', () => {
|
||||||
it('setOutput produces the correct command', () => {
|
beforeEach(() => {
|
||||||
context.setOutput('some output', 'some value');
|
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||||
assertWriteCalls([`::set-output name=some output::some value${os.EOL}`]);
|
if (!key.startsWith('INPUT_')) {
|
||||||
|
object[key] = process.env[key];
|
||||||
|
}
|
||||||
|
return object;
|
||||||
|
}, {});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
// prettier-ignore
|
||||||
it('setOutput handles bools', () => {
|
test.each([
|
||||||
context.setOutput('some output', false);
|
[
|
||||||
assertWriteCalls([`::set-output name=some output::false${os.EOL}`]);
|
0,
|
||||||
|
new Map<string, string>([
|
||||||
|
['images', 'moby/buildkit\nghcr.io/moby/mbuildkit'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
new Map<string, string>([
|
||||||
|
['bake-target', 'metadata'],
|
||||||
|
['images', 'moby/buildkit'],
|
||||||
|
['sep-labels', ','],
|
||||||
|
['sep-tags', ','],
|
||||||
|
['sep-annotations', ',']
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
context: ContextSource.workflow,
|
||||||
|
bakeTarget: 'metadata',
|
||||||
|
flavor: [],
|
||||||
|
githubToken: '',
|
||||||
|
images: ['moby/buildkit'],
|
||||||
|
labels: [],
|
||||||
|
annotations: [],
|
||||||
|
sepLabels: ',',
|
||||||
|
sepTags: ',',
|
||||||
|
sepAnnotations: ',',
|
||||||
|
tags: [],
|
||||||
|
} as Inputs
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
new Map<string, string>([
|
||||||
|
['images', 'moby/buildkit\n#comment\nghcr.io/moby/mbuildkit'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line jest/expect-expect
|
describe('getContext', () => {
|
||||||
it('setOutput handles numbers', () => {
|
const originalEnv = process.env;
|
||||||
context.setOutput('some output', 1.01);
|
beforeEach(() => {
|
||||||
assertWriteCalls([`::set-output name=some output::1.01${os.EOL}`]);
|
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, toolkit);
|
||||||
|
expect(context.ref).toEqual('refs/heads/dev');
|
||||||
|
expect(context.sha).toEqual('5f3331d7f7044c18ca9f12c77d961c4d7cf3276a');
|
||||||
|
expect(context.commitDate).toEqual(new Date('2024-11-13T13:42:28.000Z'));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('git', async () => {
|
||||||
|
jest.spyOn(Git, 'context').mockImplementation((): Promise<Context> => {
|
||||||
|
return Promise.resolve({
|
||||||
|
ref: 'refs/heads/git-test',
|
||||||
|
sha: 'git-test-sha'
|
||||||
|
} as Context);
|
||||||
|
});
|
||||||
|
jest.spyOn(Git, 'commitDate').mockImplementation(async (): Promise<Date> => {
|
||||||
|
return new Date('2023-01-01T13:42:28.000Z');
|
||||||
|
});
|
||||||
|
const context = await getContext(ContextSource.git, toolkit);
|
||||||
|
expect(context.ref).toEqual('refs/heads/git-test');
|
||||||
|
expect(context.sha).toEqual('git-test-sha');
|
||||||
|
expect(context.commitDate).toEqual(new Date('2023-01-01T13:42:28.000Z'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -198,11 +147,3 @@ function getInputName(name: string): string {
|
|||||||
function setInput(name: string, value: string): void {
|
function setInput(name: string, value: string): void {
|
||||||
process.env[getInputName(name)] = value;
|
process.env[getInputName(name)] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert that process.stdout.write calls called only with the given arguments.
|
|
||||||
function assertWriteCalls(calls: string[]): void {
|
|
||||||
expect(process.stdout.write).toHaveBeenCalledTimes(calls.length);
|
|
||||||
for (let i = 0; i < calls.length; i++) {
|
|
||||||
expect(process.stdout.write).toHaveBeenNthCalledWith(i + 1, calls[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import {describe, expect, test} from '@jest/globals';
|
import {describe, expect, test} from '@jest/globals';
|
||||||
|
|
||||||
import {Flavor, Transform} from '../src/flavor';
|
import {Flavor, Transform} from '../src/flavor';
|
||||||
|
|
||||||
describe('transform', () => {
|
describe('transform', () => {
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
import {describe, expect, jest, it} from '@jest/globals';
|
|
||||||
import * as github from '../src/github';
|
|
||||||
|
|
||||||
import * as repoFixture from './fixtures/repo.json';
|
|
||||||
jest.spyOn(github, 'repo').mockImplementation((): Promise<github.ReposGetResponseData> => {
|
|
||||||
return <Promise<github.ReposGetResponseData>>(repoFixture as unknown);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('repo', () => {
|
|
||||||
it('returns GitHub repository', async () => {
|
|
||||||
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
|
|
||||||
expect(repo.name).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import {describe, expect, test} from '@jest/globals';
|
import {describe, expect, test} from '@jest/globals';
|
||||||
|
|
||||||
import {Transform, Image} from '../src/image';
|
import {Transform, Image} from '../src/image';
|
||||||
|
|
||||||
describe('transform', () => {
|
describe('transform', () => {
|
||||||
@ -86,7 +87,7 @@ describe('transform', () => {
|
|||||||
[
|
[
|
||||||
[`name/foo,name=name/bar,enable=true`], undefined, true
|
[`name/foo,name=name/bar,enable=true`], undefined, true
|
||||||
]
|
]
|
||||||
])('given %p', async (l: string[], expected: Image[], invalid: boolean) => {
|
])('given %p', async (l: string[], expected: Image[] | undefined, invalid: boolean) => {
|
||||||
try {
|
try {
|
||||||
const images = Transform(l);
|
const images = Transform(l);
|
||||||
expect(images).toEqual(expected);
|
expect(images).toEqual(expected);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
|||||||
import {describe, expect, test} from '@jest/globals';
|
import {describe, expect, test} from '@jest/globals';
|
||||||
|
|
||||||
import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag';
|
import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag';
|
||||||
|
|
||||||
describe('transform', () => {
|
describe('transform', () => {
|
||||||
@ -31,7 +32,8 @@ describe('transform', () => {
|
|||||||
"priority": DefaultPriorities[Type.Semver],
|
"priority": DefaultPriorities[Type.Semver],
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"match": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -126,6 +128,18 @@ describe('parse', () => {
|
|||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
`type=schedule,enable=true,pattern={{date 'YYYYMMDD' tz='Asia/Tokyo'}}`,
|
||||||
|
{
|
||||||
|
type: Type.Schedule,
|
||||||
|
attrs: {
|
||||||
|
"priority": DefaultPriorities[Type.Schedule],
|
||||||
|
"enable": "true",
|
||||||
|
"pattern": `{{date 'YYYYMMDD' tz='Asia/Tokyo'}}`
|
||||||
|
}
|
||||||
|
} as Tag,
|
||||||
|
false
|
||||||
|
],
|
||||||
[
|
[
|
||||||
`type=semver,enable=true,pattern={{version}}`,
|
`type=semver,enable=true,pattern={{version}}`,
|
||||||
{
|
{
|
||||||
@ -134,7 +148,8 @@ describe('parse', () => {
|
|||||||
"priority": DefaultPriorities[Type.Semver],
|
"priority": DefaultPriorities[Type.Semver],
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"match": ""
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
@ -147,7 +162,8 @@ describe('parse', () => {
|
|||||||
"priority": "1",
|
"priority": "1",
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": ""
|
"value": "",
|
||||||
|
"match": ""
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
@ -160,7 +176,22 @@ describe('parse', () => {
|
|||||||
"priority": "1",
|
"priority": "1",
|
||||||
"enable": "true",
|
"enable": "true",
|
||||||
"pattern": "{{version}}",
|
"pattern": "{{version}}",
|
||||||
"value": "v1.0.0"
|
"value": "v1.0.0",
|
||||||
|
"match": ""
|
||||||
|
}
|
||||||
|
} as Tag,
|
||||||
|
false
|
||||||
|
],
|
||||||
|
[
|
||||||
|
`type=semver,priority=1,enable=true,pattern={{version}},value=p1/v1.0.0,"match=v(\\d.\\d.\\d)$"`,
|
||||||
|
{
|
||||||
|
type: Type.Semver,
|
||||||
|
attrs: {
|
||||||
|
"priority": "1",
|
||||||
|
"enable": "true",
|
||||||
|
"pattern": "{{version}}",
|
||||||
|
"value": "p1/v1.0.0",
|
||||||
|
"match": "v(\\d.\\d.\\d)$"
|
||||||
}
|
}
|
||||||
} as Tag,
|
} as Tag,
|
||||||
false
|
false
|
||||||
|
|||||||
28
action.yml
28
action.yml
@ -7,9 +7,13 @@ branding:
|
|||||||
color: 'blue'
|
color: 'blue'
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
context:
|
||||||
|
description: 'Where to get context data. Allowed options are "workflow" (default), "git".'
|
||||||
|
default: "workflow"
|
||||||
|
required: true
|
||||||
images:
|
images:
|
||||||
description: 'List of Docker images to use as base name for tags'
|
description: 'List of Docker images to use as base name for tags'
|
||||||
required: true
|
required: false
|
||||||
tags:
|
tags:
|
||||||
description: 'List of tags as key-value pair attributes'
|
description: 'List of tags as key-value pair attributes'
|
||||||
required: false
|
required: false
|
||||||
@ -19,12 +23,18 @@ inputs:
|
|||||||
labels:
|
labels:
|
||||||
description: 'List of custom labels'
|
description: 'List of custom labels'
|
||||||
required: false
|
required: false
|
||||||
|
annotations:
|
||||||
|
description: 'List of custom annotations'
|
||||||
|
required: false
|
||||||
sep-tags:
|
sep-tags:
|
||||||
description: 'Separator to use for tags output (default \n)'
|
description: 'Separator to use for tags output (default \n)'
|
||||||
required: false
|
required: false
|
||||||
sep-labels:
|
sep-labels:
|
||||||
description: 'Separator to use for labels output (default \n)'
|
description: 'Separator to use for labels output (default \n)'
|
||||||
required: false
|
required: false
|
||||||
|
sep-annotations:
|
||||||
|
description: 'Separator to use for annotations output (default \n)'
|
||||||
|
required: false
|
||||||
bake-target:
|
bake-target:
|
||||||
description: 'Bake target name (default docker-metadata-action)'
|
description: 'Bake target name (default docker-metadata-action)'
|
||||||
required: false
|
required: false
|
||||||
@ -38,13 +48,23 @@ outputs:
|
|||||||
description: 'Generated Docker image version'
|
description: 'Generated Docker image version'
|
||||||
tags:
|
tags:
|
||||||
description: 'Generated Docker tags'
|
description: 'Generated Docker tags'
|
||||||
|
tag-names:
|
||||||
|
description: 'Generated Docker tag names without image base name'
|
||||||
labels:
|
labels:
|
||||||
description: 'Generated Docker labels'
|
description: 'Generated Docker labels'
|
||||||
bake-file:
|
annotations:
|
||||||
description: 'Bake definiton file'
|
description: 'Generated annotations'
|
||||||
json:
|
json:
|
||||||
description: 'JSON output of tags and labels'
|
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:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
|||||||
@ -1,13 +1,20 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=16
|
ARG NODE_VERSION=20
|
||||||
|
|
||||||
FROM node:${NODE_VERSION}-alpine AS base
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
RUN apk add --no-cache cpio findutils git
|
RUN apk add --no-cache cpio findutils git
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||||
|
corepack enable
|
||||||
|
yarn --version
|
||||||
|
yarn config set --home enableTelemetry 0
|
||||||
|
EOT
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||||
|
|
||||||
@ -20,7 +27,7 @@ set -e
|
|||||||
git add -A
|
git add -A
|
||||||
cp -rf /vendor/* .
|
cp -rf /vendor/* .
|
||||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
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
|
git status --porcelain -- yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -28,6 +35,7 @@ EOT
|
|||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||||
|
|
||||||
@ -48,24 +56,25 @@ EOT
|
|||||||
|
|
||||||
FROM deps AS format
|
FROM deps AS format
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run format \
|
yarn run format \
|
||||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||||
|
|
||||||
FROM scratch AS format-update
|
FROM scratch AS format-update
|
||||||
COPY --from=format /out /
|
COPY --from=format /out /
|
||||||
|
|
||||||
FROM deps AS lint
|
FROM deps AS lint
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
FROM deps AS test
|
FROM deps AS test
|
||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run test --coverageDirectory=/tmp/coverage
|
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage /
|
COPY --from=test /tmp/coverage /
|
||||||
|
|||||||
300
dist/606.index.js
generated
vendored
Normal file
300
dist/606.index.js
generated
vendored
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
"use strict";
|
||||||
|
exports.id = 606;
|
||||||
|
exports.ids = [606];
|
||||||
|
exports.modules = {
|
||||||
|
|
||||||
|
/***/ 606:
|
||||||
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
||||||
|
|
||||||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||||
|
/* harmony export */ "default": () => (/* binding */ pMap)
|
||||||
|
/* harmony export */ });
|
||||||
|
/* unused harmony exports pMapIterable, pMapSkip */
|
||||||
|
async function pMap(
|
||||||
|
iterable,
|
||||||
|
mapper,
|
||||||
|
{
|
||||||
|
concurrency = Number.POSITIVE_INFINITY,
|
||||||
|
stopOnError = true,
|
||||||
|
signal,
|
||||||
|
} = {},
|
||||||
|
) {
|
||||||
|
return new Promise((resolve_, reject_) => {
|
||||||
|
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||||
|
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof mapper !== 'function') {
|
||||||
|
throw new TypeError('Mapper function is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = [];
|
||||||
|
const errors = [];
|
||||||
|
const skippedIndexesMap = new Map();
|
||||||
|
let isRejected = false;
|
||||||
|
let isResolved = false;
|
||||||
|
let isIterableDone = false;
|
||||||
|
let resolvingCount = 0;
|
||||||
|
let currentIndex = 0;
|
||||||
|
const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
||||||
|
|
||||||
|
const signalListener = () => {
|
||||||
|
reject(signal.reason);
|
||||||
|
};
|
||||||
|
|
||||||
|
const cleanup = () => {
|
||||||
|
signal?.removeEventListener('abort', signalListener);
|
||||||
|
};
|
||||||
|
|
||||||
|
const resolve = value => {
|
||||||
|
resolve_(value);
|
||||||
|
cleanup();
|
||||||
|
};
|
||||||
|
|
||||||
|
const reject = reason => {
|
||||||
|
isRejected = true;
|
||||||
|
isResolved = true;
|
||||||
|
reject_(reason);
|
||||||
|
cleanup();
|
||||||
|
};
|
||||||
|
|
||||||
|
if (signal) {
|
||||||
|
if (signal.aborted) {
|
||||||
|
reject(signal.reason);
|
||||||
|
}
|
||||||
|
|
||||||
|
signal.addEventListener('abort', signalListener, {once: true});
|
||||||
|
}
|
||||||
|
|
||||||
|
const next = async () => {
|
||||||
|
if (isResolved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const nextItem = await iterator.next();
|
||||||
|
|
||||||
|
const index = currentIndex;
|
||||||
|
currentIndex++;
|
||||||
|
|
||||||
|
// Note: `iterator.next()` can be called many times in parallel.
|
||||||
|
// This can cause multiple calls to this `next()` function to
|
||||||
|
// receive a `nextItem` with `done === true`.
|
||||||
|
// The shutdown logic that rejects/resolves must be protected
|
||||||
|
// so it runs only one time as the `skippedIndex` logic is
|
||||||
|
// non-idempotent.
|
||||||
|
if (nextItem.done) {
|
||||||
|
isIterableDone = true;
|
||||||
|
|
||||||
|
if (resolvingCount === 0 && !isResolved) {
|
||||||
|
if (!stopOnError && errors.length > 0) {
|
||||||
|
reject(new AggregateError(errors)); // eslint-disable-line unicorn/error-message
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isResolved = true;
|
||||||
|
|
||||||
|
if (skippedIndexesMap.size === 0) {
|
||||||
|
resolve(result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const pureResult = [];
|
||||||
|
|
||||||
|
// Support multiple `pMapSkip`'s.
|
||||||
|
for (const [index, value] of result.entries()) {
|
||||||
|
if (skippedIndexesMap.get(index) === pMapSkip) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
pureResult.push(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(pureResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
resolvingCount++;
|
||||||
|
|
||||||
|
// Intentionally detached
|
||||||
|
(async () => {
|
||||||
|
try {
|
||||||
|
const element = await nextItem.value;
|
||||||
|
|
||||||
|
if (isResolved) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = await mapper(element, index);
|
||||||
|
|
||||||
|
// Use Map to stage the index of the element.
|
||||||
|
if (value === pMapSkip) {
|
||||||
|
skippedIndexesMap.set(index, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
result[index] = value;
|
||||||
|
|
||||||
|
resolvingCount--;
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
if (stopOnError) {
|
||||||
|
reject(error);
|
||||||
|
} else {
|
||||||
|
errors.push(error);
|
||||||
|
resolvingCount--;
|
||||||
|
|
||||||
|
// In that case we can't really continue regardless of `stopOnError` state
|
||||||
|
// since an iterable is likely to continue throwing after it throws once.
|
||||||
|
// If we continue calling `next()` indefinitely we will likely end up
|
||||||
|
// in an infinite loop of failed iteration.
|
||||||
|
try {
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create the concurrent runners in a detached (non-awaited)
|
||||||
|
// promise. We need this so we can await the `next()` calls
|
||||||
|
// to stop creating runners before hitting the concurrency limit
|
||||||
|
// if the iterable has already been marked as done.
|
||||||
|
// NOTE: We *must* do this for async iterators otherwise we'll spin up
|
||||||
|
// infinite `next()` calls by default and never start the event loop.
|
||||||
|
(async () => {
|
||||||
|
for (let index = 0; index < concurrency; index++) {
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line no-await-in-loop
|
||||||
|
await next();
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isIterableDone || isRejected) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function pMapIterable(
|
||||||
|
iterable,
|
||||||
|
mapper,
|
||||||
|
{
|
||||||
|
concurrency = Number.POSITIVE_INFINITY,
|
||||||
|
backpressure = concurrency,
|
||||||
|
} = {},
|
||||||
|
) {
|
||||||
|
if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
|
||||||
|
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof mapper !== 'function') {
|
||||||
|
throw new TypeError('Mapper function is required');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(concurrency) && concurrency >= 1) || concurrency === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((Number.isSafeInteger(backpressure) && backpressure >= concurrency) || backpressure === Number.POSITIVE_INFINITY)) {
|
||||||
|
throw new TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${concurrency}) and up or \`Infinity\`, got \`${backpressure}\` (${typeof backpressure})`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
async * [Symbol.asyncIterator]() {
|
||||||
|
const iterator = iterable[Symbol.asyncIterator] === undefined ? iterable[Symbol.iterator]() : iterable[Symbol.asyncIterator]();
|
||||||
|
|
||||||
|
const promises = [];
|
||||||
|
let runningMappersCount = 0;
|
||||||
|
let isDone = false;
|
||||||
|
let index = 0;
|
||||||
|
|
||||||
|
function trySpawn() {
|
||||||
|
if (isDone || !(runningMappersCount < concurrency && promises.length < backpressure)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const promise = (async () => {
|
||||||
|
const {done, value} = await iterator.next();
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
return {done: true};
|
||||||
|
}
|
||||||
|
|
||||||
|
runningMappersCount++;
|
||||||
|
|
||||||
|
// Spawn if still below concurrency and backpressure limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
try {
|
||||||
|
const returnValue = await mapper(await value, index++);
|
||||||
|
|
||||||
|
runningMappersCount--;
|
||||||
|
|
||||||
|
if (returnValue === pMapSkip) {
|
||||||
|
const index = promises.indexOf(promise);
|
||||||
|
|
||||||
|
if (index > 0) {
|
||||||
|
promises.splice(index, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spawn if still below backpressure limit and just dropped below concurrency limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
return {done: false, value: returnValue};
|
||||||
|
} catch (error) {
|
||||||
|
isDone = true;
|
||||||
|
return {error};
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
|
promises.push(promise);
|
||||||
|
}
|
||||||
|
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
while (promises.length > 0) {
|
||||||
|
const {error, done, value} = await promises[0]; // eslint-disable-line no-await-in-loop
|
||||||
|
|
||||||
|
promises.shift();
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spawn if just dropped below backpressure limit and below the concurrency limit
|
||||||
|
trySpawn();
|
||||||
|
|
||||||
|
if (value === pMapSkip) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const pMapSkip = Symbol('skip');
|
||||||
|
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
};
|
||||||
|
;
|
||||||
|
//# sourceMappingURL=606.index.js.map
|
||||||
1
dist/606.index.js.map
generated
vendored
Normal file
1
dist/606.index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
161
dist/index.js
generated
vendored
161
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
859
dist/licenses.txt
generated
vendored
859
dist/licenses.txt
generated
vendored
@ -1,866 +1,11 @@
|
|||||||
@actions/core
|
p-map
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@actions/github
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
@actions/http-client
|
|
||||||
MIT
|
|
||||||
Actions Http Client for Node.js
|
|
||||||
|
|
||||||
Copyright (c) GitHub, Inc.
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
||||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@babel/runtime-corejs3
|
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/auth-token
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/core
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/endpoint
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/graphql
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/plugin-paginate-rest
|
|
||||||
MIT
|
|
||||||
MIT License Copyright (c) 2019 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/plugin-rest-endpoint-methods
|
|
||||||
MIT
|
|
||||||
MIT License Copyright (c) 2019 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/request
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@octokit/request-error
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Octokit contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
@renovate/pep440
|
|
||||||
Apache-2.0
|
|
||||||
This software is made available under the terms of *either* of the licenses
|
|
||||||
found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made
|
|
||||||
under the terms of *both* these licenses.
|
|
||||||
|
|
||||||
|
|
||||||
@vercel/ncc
|
|
||||||
MIT
|
|
||||||
Copyright 2018 ZEIT, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
before-after-hook
|
|
||||||
Apache-2.0
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Copyright 2018 Gregor Martynus and other contributors.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
|
|
||||||
core-js-pure
|
|
||||||
MIT
|
|
||||||
Copyright (c) 2014-2021 Denis Pushkarev
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
csv-parse
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2010 Adaltas
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
deprecation
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Gregor Martynus and contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
handlebars
|
|
||||||
MIT
|
|
||||||
Copyright (C) 2011-2019 by Yehuda Katz
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
is-plain-object
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
lru-cache
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
moment
|
|
||||||
MIT
|
|
||||||
Copyright (c) JS Foundation and other contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person
|
|
||||||
obtaining a copy of this software and associated documentation
|
|
||||||
files (the "Software"), to deal in the Software without
|
|
||||||
restriction, including without limitation the rights to use,
|
|
||||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the
|
|
||||||
Software is furnished to do so, subject to the following
|
|
||||||
conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
||||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
||||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
node-fetch
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2016 David Frank
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
once
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
semver
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
source-map
|
|
||||||
BSD-3-Clause
|
|
||||||
|
|
||||||
Copyright (c) 2009-2011, Mozilla Foundation and contributors
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this
|
|
||||||
list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
this list of conditions and the following disclaimer in the documentation
|
|
||||||
and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
* Neither the names of the Mozilla Foundation nor the names of project
|
|
||||||
contributors may be used to endorse or promote products derived from this
|
|
||||||
software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
||||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
||||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
||||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
||||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
||||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
tr46
|
|
||||||
MIT
|
|
||||||
|
|
||||||
tunnel
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2012 Koichi Kobayashi
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
universal-user-agent
|
|
||||||
ISC
|
|
||||||
# [ISC License](https://spdx.org/licenses/ISC)
|
|
||||||
|
|
||||||
Copyright (c) 2018, Gregor Martynus (https://github.com/gr2m)
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
webidl-conversions
|
|
||||||
BSD-2-Clause
|
|
||||||
# The BSD 2-Clause License
|
|
||||||
|
|
||||||
Copyright (c) 2014, Domenic Denicola
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
||||||
|
|
||||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
||||||
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
whatwg-url
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2015–2016 Sebastian Mayr
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
wrappy
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
xregexp
|
|
||||||
MIT
|
|
||||||
The MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2007-present Steven Levithan <http://xregexp.com/>
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
yallist
|
|
||||||
ISC
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|||||||
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,9 +1,15 @@
|
|||||||
|
target "_common" {
|
||||||
|
args = {
|
||||||
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "pre-checkin" {
|
group "pre-checkin" {
|
||||||
targets = ["vendor-update", "format", "build"]
|
targets = ["vendor", "format", "build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
@ -11,42 +17,49 @@ group "validate" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
target "build" {
|
target "build" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-update"
|
target = "build-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "format" {
|
target "format" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "format-update"
|
target = "format-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "lint" {
|
target "lint" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "lint"
|
target = "lint"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-update" {
|
target "vendor" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "test-coverage"
|
target = "test-coverage"
|
||||||
output = ["./coverage"]
|
output = ["./coverage"]
|
||||||
|
|||||||
@ -1,5 +1,21 @@
|
|||||||
|
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 = {
|
module.exports = {
|
||||||
clearMocks: true,
|
clearMocks: true,
|
||||||
|
testEnvironment: 'node',
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
moduleFileExtensions: ['js', 'ts'],
|
||||||
setupFiles: ['dotenv/config'],
|
setupFiles: ['dotenv/config'],
|
||||||
testMatch: ['**/*.test.ts'],
|
testMatch: ['**/*.test.ts'],
|
||||||
@ -9,5 +25,7 @@ module.exports = {
|
|||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
'^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
|
verbose: true
|
||||||
};
|
};
|
||||||
|
|||||||
69
package.json
69
package.json
@ -1,13 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "docker-metadata-action",
|
"name": "docker-metadata-action",
|
||||||
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
||||||
"main": "lib/main.js",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
"lint": "yarn run prettier && yarn run eslint",
|
||||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||||
"test": "jest --coverage",
|
"eslint": "eslint --max-warnings=0 .",
|
||||||
"all": "yarn run build && yarn run format && yarn test"
|
"eslint:fix": "eslint --fix .",
|
||||||
|
"prettier": "prettier --check \"./**/*.ts\"",
|
||||||
|
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||||
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -20,39 +23,35 @@
|
|||||||
"tag",
|
"tag",
|
||||||
"label"
|
"label"
|
||||||
],
|
],
|
||||||
"author": "Docker",
|
"author": "Docker Inc.",
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "CrazyMax",
|
|
||||||
"url": "https://crazymax.dev"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"packageManager": "yarn@4.9.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/github": "^5.0.1",
|
"@actions/github": "^6.0.1",
|
||||||
|
"@docker/actions-toolkit": "^0.68.0",
|
||||||
"@renovate/pep440": "^1.0.0",
|
"@renovate/pep440": "^1.0.0",
|
||||||
"csv-parse": "^5.0.4",
|
"csv-parse": "^6.1.0",
|
||||||
"handlebars": "^4.7.7",
|
"handlebars": "^4.7.8",
|
||||||
"moment": "^2.29.3",
|
"moment": "^2.30.1",
|
||||||
"semver": "^7.3.7"
|
"moment-timezone": "^0.6.0",
|
||||||
|
"semver": "^7.7.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/csv-parse": "^1.2.2",
|
"@types/node": "^20.19.9",
|
||||||
"@types/node": "^16.11.26",
|
"@types/semver": "^7.7.1",
|
||||||
"@types/semver": "^7.3.9",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^5.14.0",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"@vercel/ncc": "^0.33.3",
|
"dotenv": "^16.6.1",
|
||||||
"dotenv": "^16.0.0",
|
"eslint": "^8.57.1",
|
||||||
"eslint": "^8.11.0",
|
"eslint-config-prettier": "^9.1.2",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-plugin-jest": "^28.14.0",
|
||||||
"eslint-plugin-jest": "^26.1.1",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"eslint-plugin-prettier": "^4.0.0",
|
"jest": "^29.7.0",
|
||||||
"jest": "^27.2.5",
|
"prettier": "^3.6.2",
|
||||||
"prettier": "^2.3.1",
|
"ts-jest": "^29.4.1",
|
||||||
"ts-jest": "^27.1.2",
|
"ts-node": "^10.9.2",
|
||||||
"ts-node": "^10.7.0",
|
"typescript": "^5.9.2"
|
||||||
"typescript": "^4.4.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
152
src/context.ts
152
src/context.ts
@ -1,80 +1,136 @@
|
|||||||
import {parse} from 'csv-parse/sync';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {issueCommand} from '@actions/core/lib/command';
|
import {Context as GithubContext} from '@actions/github/lib/context';
|
||||||
import * as fs from 'fs';
|
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||||
import * as os from 'os';
|
import {Git} from '@docker/actions-toolkit/lib/git';
|
||||||
import * as path from 'path';
|
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||||
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||||
|
|
||||||
let _tmpDir: string;
|
export interface Context extends GithubContext {
|
||||||
|
commitDate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
|
context: ContextSource;
|
||||||
images: string[];
|
images: string[];
|
||||||
tags: string[];
|
tags: string[];
|
||||||
flavor: string[];
|
flavor: string[];
|
||||||
labels: string[];
|
labels: string[];
|
||||||
|
annotations: string[];
|
||||||
sepTags: string;
|
sepTags: string;
|
||||||
sepLabels: string;
|
sepLabels: string;
|
||||||
|
sepAnnotations: string;
|
||||||
bakeTarget: string;
|
bakeTarget: string;
|
||||||
githubToken: string;
|
githubToken: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function tmpDir(): string {
|
|
||||||
if (!_tmpDir) {
|
|
||||||
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-')).split(path.sep).join(path.posix.sep);
|
|
||||||
}
|
|
||||||
return _tmpDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
return {
|
return {
|
||||||
images: getInputList('images', true),
|
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||||
tags: getInputList('tags', true),
|
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
|
||||||
flavor: getInputList('flavor', true),
|
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
||||||
labels: getInputList('labels', true),
|
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
||||||
sepTags: core.getInput('sep-tags') || `\n`,
|
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
||||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#'}),
|
||||||
|
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`,
|
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
|
||||||
githubToken: core.getInput('github-token')
|
githubToken: core.getInput('github-token')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInputList(name: string, ignoreComma?: boolean): string[] {
|
export enum ContextSource {
|
||||||
const res: Array<string> = [];
|
workflow = 'workflow',
|
||||||
|
git = 'git'
|
||||||
const items = core.getInput(name);
|
|
||||||
if (items == '') {
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const records = parse(items, {
|
export async function getContext(source: ContextSource, toolkit: Toolkit): Promise<Context> {
|
||||||
columns: false,
|
switch (source) {
|
||||||
relaxQuotes: true,
|
case ContextSource.workflow:
|
||||||
comment: '#',
|
return await getContextFromWorkflow(toolkit);
|
||||||
relaxColumnCount: true,
|
case ContextSource.git:
|
||||||
skipEmptyLines: true
|
return await getContextFromGit();
|
||||||
});
|
default:
|
||||||
|
throw new Error(`Invalid context source: ${source}`);
|
||||||
for (const record of records as Array<string[]>) {
|
|
||||||
if (record.length == 1) {
|
|
||||||
res.push(record[0]);
|
|
||||||
continue;
|
|
||||||
} else if (!ignoreComma) {
|
|
||||||
res.push(...record);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
res.push(record.join(','));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.filter(item => item).map(pat => pat.trim());
|
async function getContextFromWorkflow(toolkit: Toolkit): Promise<Context> {
|
||||||
|
const context = GitHub.context;
|
||||||
|
|
||||||
|
// Needs to override Git reference with pr ref instead of upstream branch ref
|
||||||
|
// for pull_request_target event
|
||||||
|
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
|
||||||
|
if (/pull_request_target/.test(context.eventName)) {
|
||||||
|
context.ref = `refs/pull/${context.payload.number}/merge`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const asyncForEach = async (array, callback) => {
|
// DOCKER_METADATA_PR_HEAD_SHA env var can be used to set associated head
|
||||||
for (let index = 0; index < array.length; index++) {
|
// SHA instead of commit SHA that triggered the workflow on pull request
|
||||||
await callback(array[index], index, array);
|
// event.
|
||||||
|
if (/true/i.test(process.env.DOCKER_METADATA_PR_HEAD_SHA || '')) {
|
||||||
|
if ((/pull_request/.test(context.eventName) || /pull_request_target/.test(context.eventName)) && context.payload?.pull_request?.head?.sha != undefined) {
|
||||||
|
context.sha = context.payload.pull_request.head.sha;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
commitDate: await getCommitDateFromWorkflow(context.sha, toolkit),
|
||||||
|
...context
|
||||||
|
} as Context;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getContextFromGit(): Promise<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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
|
if (event.commits) {
|
||||||
export function setOutput(name: string, value: unknown): void {
|
const commitDate = event.commits.find(x => x.id === sha)?.timestamp;
|
||||||
issueCommand('set-output', {name}, value);
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +0,0 @@
|
|||||||
import * as github from '@actions/github';
|
|
||||||
import {Context} from '@actions/github/lib/context';
|
|
||||||
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
|
|
||||||
|
|
||||||
export type ReposGetResponseData = OctoOpenApiTypes['schemas']['repository'];
|
|
||||||
|
|
||||||
export function context(): Context {
|
|
||||||
return github.context;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function repo(token: string): Promise<ReposGetResponseData> {
|
|
||||||
return github
|
|
||||||
.getOctokit(token)
|
|
||||||
.rest.repos.get({...github.context.repo})
|
|
||||||
.then(response => response.data as ReposGetResponseData);
|
|
||||||
}
|
|
||||||
107
src/main.ts
107
src/main.ts
@ -1,20 +1,22 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import {getInputs, Inputs, setOutput} from './context';
|
|
||||||
import * as github from './github';
|
|
||||||
import {Meta, Version} from './meta';
|
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {Context} from '@actions/github/lib/context';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||||
|
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||||
|
|
||||||
async function run() {
|
import {getContext, getInputs, Inputs} from './context';
|
||||||
try {
|
import {Meta, Version} from './meta';
|
||||||
const inputs: Inputs = await getInputs();
|
|
||||||
if (inputs.images.length == 0) {
|
|
||||||
throw new Error(`images input required`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const context: Context = github.context();
|
actionsToolkit.run(
|
||||||
const repo: github.ReposGetResponseData = await github.repo(inputs.githubToken);
|
// main
|
||||||
core.startGroup(`Context info`);
|
async () => {
|
||||||
|
const inputs: Inputs = getInputs();
|
||||||
|
const toolkit = new Toolkit({githubToken: inputs.githubToken});
|
||||||
|
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}`);
|
core.info(`eventName: ${context.eventName}`);
|
||||||
core.info(`sha: ${context.sha}`);
|
core.info(`sha: ${context.sha}`);
|
||||||
core.info(`ref: ${context.ref}`);
|
core.info(`ref: ${context.ref}`);
|
||||||
@ -23,12 +25,13 @@ async function run() {
|
|||||||
core.info(`actor: ${context.actor}`);
|
core.info(`actor: ${context.actor}`);
|
||||||
core.info(`runNumber: ${context.runNumber}`);
|
core.info(`runNumber: ${context.runNumber}`);
|
||||||
core.info(`runId: ${context.runId}`);
|
core.info(`runId: ${context.runId}`);
|
||||||
core.endGroup();
|
core.info(`commitDate: ${context.commitDate}`);
|
||||||
|
});
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
core.startGroup(`Webhook payload`);
|
await core.group(`Webhook payload`, async () => {
|
||||||
core.info(JSON.stringify(context.payload, null, 2));
|
core.info(JSON.stringify(context.payload, null, 2));
|
||||||
core.endGroup();
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const meta: Meta = new Meta(inputs, context, repo);
|
const meta: Meta = new Meta(inputs, context, repo);
|
||||||
@ -37,50 +40,82 @@ async function run() {
|
|||||||
if (meta.version.main == undefined || meta.version.main.length == 0) {
|
if (meta.version.main == undefined || meta.version.main.length == 0) {
|
||||||
core.warning(`No Docker image version has been generated. Check tags input.`);
|
core.warning(`No Docker image version has been generated. Check tags input.`);
|
||||||
} else {
|
} else {
|
||||||
core.startGroup(`Docker image version`);
|
await core.group(`Docker image version`, async () => {
|
||||||
core.info(version.main || '');
|
core.info(version.main || '');
|
||||||
core.endGroup();
|
});
|
||||||
}
|
}
|
||||||
setOutput('version', version.main || '');
|
setOutput('version', version.main || '');
|
||||||
|
|
||||||
// Docker tags
|
// Docker tags
|
||||||
const tags: Array<string> = meta.getTags();
|
const tags = meta.getTags();
|
||||||
if (tags.length == 0) {
|
if (tags.length == 0) {
|
||||||
core.warning('No Docker tag has been generated. Check tags input.');
|
core.warning('No Docker tag has been generated. Check tags input.');
|
||||||
} else {
|
} else {
|
||||||
core.startGroup(`Docker tags`);
|
await core.group(`Docker tags`, async () => {
|
||||||
for (const tag of tags) {
|
for (const tag of tags) {
|
||||||
core.info(tag);
|
core.info(tag);
|
||||||
}
|
}
|
||||||
core.endGroup();
|
});
|
||||||
}
|
}
|
||||||
setOutput('tags', tags.join(inputs.sepTags));
|
setOutput('tags', tags.join(inputs.sepTags));
|
||||||
|
setOutput('tag-names', meta.getTags(true).join(inputs.sepTags));
|
||||||
|
|
||||||
// Docker labels
|
// Docker labels
|
||||||
const labels: Array<string> = meta.getLabels();
|
const labels: Array<string> = meta.getLabels();
|
||||||
core.startGroup(`Docker labels`);
|
await core.group(`Docker labels`, async () => {
|
||||||
for (const label of labels) {
|
for (const label of labels) {
|
||||||
core.info(label);
|
core.info(label);
|
||||||
}
|
}
|
||||||
core.endGroup();
|
|
||||||
setOutput('labels', labels.join(inputs.sepLabels));
|
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
|
// JSON
|
||||||
const jsonOutput = meta.getJSON();
|
const jsonOutput = meta.getJSON(annotationsLevels.split(','));
|
||||||
core.startGroup(`JSON output`);
|
await core.group(`JSON output`, async () => {
|
||||||
core.info(JSON.stringify(jsonOutput, null, 2));
|
core.info(JSON.stringify(jsonOutput, null, 2));
|
||||||
core.endGroup();
|
setOutput('json', JSON.stringify(jsonOutput));
|
||||||
setOutput('json', jsonOutput);
|
});
|
||||||
|
|
||||||
// Bake definition file
|
// Bake files
|
||||||
const bakeFile: string = meta.getBakeFile();
|
for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) {
|
||||||
core.startGroup(`Bake definition file`);
|
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'));
|
core.info(fs.readFileSync(bakeFile, 'utf8'));
|
||||||
core.endGroup();
|
setOutput(`bake-file-${outputName}`, bakeFile);
|
||||||
setOutput('bake-file', bakeFile);
|
});
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(error.message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
run();
|
// 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;
|
||||||
|
}
|
||||||
|
|||||||
293
src/meta.ts
293
src/meta.ts
@ -1,16 +1,19 @@
|
|||||||
import * as handlebars from 'handlebars';
|
import * as handlebars from 'handlebars';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import moment from 'moment';
|
import moment from 'moment-timezone';
|
||||||
import * as pep440 from '@renovate/pep440';
|
import * as pep440 from '@renovate/pep440';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import {Inputs, tmpDir} from './context';
|
import * as core from '@actions/core';
|
||||||
import {ReposGetResponseData} from './github';
|
import {Context as ToolkitContext} from '@docker/actions-toolkit/lib/context';
|
||||||
|
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
|
||||||
|
|
||||||
|
import {Inputs, Context} from './context';
|
||||||
import * as icl from './image';
|
import * as icl from './image';
|
||||||
import * as tcl from './tag';
|
import * as tcl from './tag';
|
||||||
import * as fcl from './flavor';
|
import * as fcl from './flavor';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import {Context} from '@actions/github/lib/context';
|
const defaultShortShaLength = 7;
|
||||||
|
|
||||||
export interface Version {
|
export interface Version {
|
||||||
main: string | undefined;
|
main: string | undefined;
|
||||||
@ -23,20 +26,13 @@ export class Meta {
|
|||||||
|
|
||||||
private readonly inputs: Inputs;
|
private readonly inputs: Inputs;
|
||||||
private readonly context: Context;
|
private readonly context: Context;
|
||||||
private readonly repo: ReposGetResponseData;
|
private readonly repo: GitHubRepo;
|
||||||
private readonly images: icl.Image[];
|
private readonly images: icl.Image[];
|
||||||
private readonly tags: tcl.Tag[];
|
private readonly tags: tcl.Tag[];
|
||||||
private readonly flavor: fcl.Flavor;
|
private readonly flavor: fcl.Flavor;
|
||||||
private readonly date: Date;
|
private readonly date: Date;
|
||||||
|
|
||||||
constructor(inputs: Inputs, context: Context, repo: ReposGetResponseData) {
|
constructor(inputs: Inputs, context: Context, repo: GitHubRepo) {
|
||||||
// Needs to override Git reference with pr ref instead of upstream branch ref
|
|
||||||
// for pull_request_target event
|
|
||||||
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
|
|
||||||
if (/pull_request_target/.test(context.eventName)) {
|
|
||||||
context.ref = `refs/pull/${context.payload.number}/merge`;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inputs = inputs;
|
this.inputs = inputs;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.repo = repo;
|
this.repo = repo;
|
||||||
@ -118,10 +114,36 @@ export class Meta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currentDate = this.date;
|
const currentDate = this.date;
|
||||||
|
const commitDate = this.context.commitDate;
|
||||||
const vraw = this.setValue(
|
const vraw = this.setValue(
|
||||||
handlebars.compile(tag.attrs['pattern'])({
|
handlebars.compile(tag.attrs['pattern'])({
|
||||||
date: function (format) {
|
date: function (format, options) {
|
||||||
return moment(currentDate).utc().format(format);
|
const m = moment(currentDate);
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
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
|
tag
|
||||||
@ -139,8 +161,20 @@ export class Meta {
|
|||||||
if (tag.attrs['value'].length > 0) {
|
if (tag.attrs['value'].length > 0) {
|
||||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||||
} else {
|
} else {
|
||||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '').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)) {
|
if (!semver.valid(vraw)) {
|
||||||
core.warning(`${vraw} is not a valid semver. More info: https://semver.org/`);
|
core.warning(`${vraw} is not a valid semver. More info: https://semver.org/`);
|
||||||
return version;
|
return version;
|
||||||
@ -148,7 +182,7 @@ export class Meta {
|
|||||||
|
|
||||||
let latest = false;
|
let latest = false;
|
||||||
const sver = semver.parse(vraw, {
|
const sver = semver.parse(vraw, {
|
||||||
includePrerelease: true
|
loose: true
|
||||||
});
|
});
|
||||||
if (semver.prerelease(vraw)) {
|
if (semver.prerelease(vraw)) {
|
||||||
if (Meta.isRawStatement(tag.attrs['pattern'])) {
|
if (Meta.isRawStatement(tag.attrs['pattern'])) {
|
||||||
@ -173,8 +207,20 @@ export class Meta {
|
|||||||
if (tag.attrs['value'].length > 0) {
|
if (tag.attrs['value'].length > 0) {
|
||||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||||
} else {
|
} else {
|
||||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '').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)) {
|
if (!pep440.valid(vraw)) {
|
||||||
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
core.warning(`${vraw} does not conform to PEP 440. More info: https://www.python.org/dev/peps/pep-0440`);
|
||||||
return version;
|
return version;
|
||||||
@ -301,7 +347,7 @@ export class Meta {
|
|||||||
|
|
||||||
let val = this.context.sha;
|
let val = this.context.sha;
|
||||||
if (tag.attrs['format'] === tcl.ShaFormat.Short) {
|
if (tag.attrs['format'] === tcl.ShaFormat.Short) {
|
||||||
val = this.context.sha.substr(0, 7);
|
val = Meta.shortSha(this.context.sha);
|
||||||
}
|
}
|
||||||
|
|
||||||
const vraw = this.setValue(val, tag);
|
const vraw = this.setValue(val, tag);
|
||||||
@ -350,60 +396,89 @@ export class Meta {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
private setGlobalExp(val): string {
|
private setGlobalExp(val: string): string {
|
||||||
const ctx = this.context;
|
const context = this.context;
|
||||||
const currentDate = this.date;
|
const currentDate = this.date;
|
||||||
|
const commitDate = this.context.commitDate;
|
||||||
return handlebars.compile(val)({
|
return handlebars.compile(val)({
|
||||||
branch: function () {
|
branch: function () {
|
||||||
if (!/^refs\/heads\//.test(ctx.ref)) {
|
if (!/^refs\/heads\//.test(context.ref)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return ctx.ref.replace(/^refs\/heads\//g, '');
|
return context.ref.replace(/^refs\/heads\//g, '');
|
||||||
},
|
},
|
||||||
tag: function () {
|
tag: function () {
|
||||||
if (!/^refs\/tags\//.test(ctx.ref)) {
|
if (!/^refs\/tags\//.test(context.ref)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
return ctx.ref.replace(/^refs\/tags\//g, '');
|
return context.ref.replace(/^refs\/tags\//g, '');
|
||||||
},
|
},
|
||||||
sha: function () {
|
sha: function () {
|
||||||
return ctx.sha.substr(0, 7);
|
return Meta.shortSha(context.sha);
|
||||||
},
|
},
|
||||||
base_ref: function () {
|
base_ref: function () {
|
||||||
if (/^refs\/tags\//.test(ctx.ref) && ctx.payload?.base_ref != undefined) {
|
if (/^refs\/tags\//.test(context.ref) && context.payload?.base_ref != undefined) {
|
||||||
return ctx.payload.base_ref.replace(/^refs\/heads\//g, '');
|
return context.payload.base_ref.replace(/^refs\/heads\//g, '');
|
||||||
}
|
}
|
||||||
// FIXME: keep this for backward compatibility even if doesn't always seem
|
// FIXME: keep this for backward compatibility even if doesn't always seem
|
||||||
// to return the expected branch. See the comment below.
|
// to return the expected branch. See the comment below.
|
||||||
if (/^refs\/pull\//.test(ctx.ref) && ctx.payload?.pull_request?.base?.ref != undefined) {
|
if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
|
||||||
return ctx.payload.pull_request.base.ref;
|
return context.payload.pull_request.base.ref;
|
||||||
}
|
}
|
||||||
return '';
|
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 () {
|
is_default_branch: function () {
|
||||||
const branch = ctx.ref.replace(/^refs\/heads\//g, '');
|
const branch = context.ref.replace(/^refs\/heads\//g, '');
|
||||||
// TODO: "base_ref" is available in the push payload but doesn't always seem to
|
// TODO: "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
|
// 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
|
// documented in GitHub docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push
|
||||||
// more context: https://github.com/docker/metadata-action/pull/192#discussion_r854673012
|
// more context: https://github.com/docker/metadata-action/pull/192#discussion_r854673012
|
||||||
// if (/^refs\/tags\//.test(ctx.ref) && ctx.payload?.base_ref != undefined) {
|
// if (/^refs\/tags\//.test(context.ref) && context.payload?.base_ref != undefined) {
|
||||||
// branch = ctx.payload.base_ref.replace(/^refs\/heads\//g, '');
|
// branch = context.payload.base_ref.replace(/^refs\/heads\//g, '');
|
||||||
// }
|
// }
|
||||||
if (branch == undefined || branch.length == 0) {
|
if (branch == undefined || branch.length == 0) {
|
||||||
return 'false';
|
return 'false';
|
||||||
}
|
}
|
||||||
if (ctx.payload?.repository?.default_branch == branch) {
|
if (context.payload?.repository?.default_branch == branch) {
|
||||||
return 'true';
|
return 'true';
|
||||||
}
|
}
|
||||||
// following events always trigger for last commit on default branch
|
// following events always trigger for last commit on default branch
|
||||||
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
|
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
|
||||||
if (/create/.test(ctx.eventName) || /discussion/.test(ctx.eventName) || /issues/.test(ctx.eventName) || /schedule/.test(ctx.eventName)) {
|
if (/create/.test(context.eventName) || /discussion/.test(context.eventName) || /issues/.test(context.eventName) || /schedule/.test(context.eventName)) {
|
||||||
return 'true';
|
return 'true';
|
||||||
}
|
}
|
||||||
return 'false';
|
return 'false';
|
||||||
},
|
},
|
||||||
date: function (format) {
|
is_not_default_branch: function () {
|
||||||
return moment(currentDate).utc().format(format);
|
return this.is_default_branch() === 'false' ? 'true' : 'false';
|
||||||
|
},
|
||||||
|
date: function (format, options) {
|
||||||
|
const m = moment(currentDate);
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -419,26 +494,51 @@ export class Meta {
|
|||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getTags(): Array<string> {
|
public getTags(namesOnly?: boolean): Array<string> {
|
||||||
if (!this.version.main) {
|
if (!this.version.main) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
if (namesOnly) {
|
||||||
|
return this.generateTags(this.version.main);
|
||||||
|
}
|
||||||
|
|
||||||
const tags: Array<string> = [];
|
const tags: Array<string> = [];
|
||||||
for (const imageName of this.getImageNames()) {
|
const images = this.getImageNames();
|
||||||
tags.push(`${imageName}:${this.version.main}`);
|
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) {
|
for (const partial of this.version.partial) {
|
||||||
tags.push(`${imageName}:${partial}`);
|
tags.push(`${prefix}${partial}`);
|
||||||
}
|
}
|
||||||
if (this.version.latest) {
|
if (this.version.latest) {
|
||||||
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
|
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;
|
||||||
tags.push(`${imageName}:${Meta.sanitizeTag(latestTag)}`);
|
tags.push(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getLabels(): Array<string> {
|
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.title=${this.repo.name || ''}`,
|
||||||
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
||||||
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
||||||
@ -448,13 +548,58 @@ export class Meta {
|
|||||||
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
||||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||||
];
|
];
|
||||||
labels.push(...this.inputs.labels);
|
extra.forEach(label => {
|
||||||
return labels;
|
res.push(this.setGlobalExp(label));
|
||||||
|
});
|
||||||
|
|
||||||
|
return Array.from(
|
||||||
|
new Map<string, string>(
|
||||||
|
res
|
||||||
|
.map(label => label.split('='))
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
.filter(([_key, ...values]) => values.length > 0)
|
||||||
|
.map(([key, ...values]) => [key, values.join('=')] as [string, string])
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.sort((a, b) => a[0].localeCompare(b[0]))
|
||||||
|
.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 {
|
return {
|
||||||
tags: this.getTags(),
|
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) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
if (!matches) {
|
if (!matches) {
|
||||||
@ -463,17 +608,27 @@ export class Meta {
|
|||||||
res[matches[1]] = matches[2];
|
res[matches[1]] = matches[2];
|
||||||
return res;
|
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 getBakeFile(): string {
|
public getBakeFileTagsLabels(): string {
|
||||||
const bakeFile = path.join(tmpDir(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep);
|
return this.generateBakeFile({
|
||||||
fs.writeFileSync(
|
|
||||||
bakeFile,
|
|
||||||
JSON.stringify(
|
|
||||||
{
|
|
||||||
target: {
|
|
||||||
[this.inputs.bakeTarget]: {
|
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
@ -487,14 +642,12 @@ export class Meta {
|
|||||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||||
DOCKER_META_VERSION: this.version.main
|
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;
|
return bakeFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,4 +658,18 @@ export class Meta {
|
|||||||
private static sanitizeTag(tag: string): string {
|
private static sanitizeTag(tag: string): string {
|
||||||
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,7 +95,7 @@ export function Parse(s: string): Tag {
|
|||||||
for (const field of fields) {
|
for (const field of fields) {
|
||||||
const parts = field
|
const parts = field
|
||||||
.toString()
|
.toString()
|
||||||
.split('=')
|
.split(/(?<=^[^=]+?)=/)
|
||||||
.map(item => item.trim());
|
.map(item => item.trim());
|
||||||
if (parts.length == 1) {
|
if (parts.length == 1) {
|
||||||
tag.attrs['value'] = parts[0];
|
tag.attrs['value'] = parts[0];
|
||||||
@ -104,10 +104,10 @@ export function Parse(s: string): Tag {
|
|||||||
const value = parts[1];
|
const value = parts[1];
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 'type': {
|
case 'type': {
|
||||||
if (!Object.values(Type).includes(value)) {
|
if (!Object.values(Type).includes(value as Type)) {
|
||||||
throw new Error(`Unknown tag type attribute: ${value}`);
|
throw new Error(`Unknown tag type attribute: ${value}`);
|
||||||
}
|
}
|
||||||
tag.type = value;
|
tag.type = value as Type;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -137,6 +137,9 @@ export function Parse(s: string): Tag {
|
|||||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'value')) {
|
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'value')) {
|
||||||
tag.attrs['value'] = '';
|
tag.attrs['value'] = '';
|
||||||
}
|
}
|
||||||
|
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'match')) {
|
||||||
|
tag.attrs['match'] = '';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Type.Match: {
|
case Type.Match: {
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
FROM alpine
|
FROM alpine
|
||||||
|
|
||||||
RUN echo "Hello world!"
|
RUN echo "Hello world!"
|
||||||
|
|||||||
14
test/output.Dockerfile
Normal file
14
test/output.Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM alpine
|
||||||
|
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
|
||||||
@ -1,20 +1,22 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"esModuleInterop": true,
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
|
"strict": true,
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"esModuleInterop": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"strict": true,
|
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false,
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
"./__mocks__/**/*",
|
||||||
|
"./__tests__/**/*",
|
||||||
|
"./lib/**/*",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"**/*.test.ts",
|
|
||||||
"jest.config.ts"
|
"jest.config.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user