mirror of
https://github.com/docker/metadata-action.git
synced 2025-04-04 09:10:25 +02:00
Compare commits
369 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
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 | ||
|
69f6fc9d46 | ||
|
2f5b5ae8bf | ||
|
f206c36955 | ||
|
a20adfa74e | ||
|
26b9439ce3 | ||
|
467883f452 | ||
|
5edf56f2c4 | ||
|
678218f2be | ||
|
e44c1fbe6e | ||
|
b2391d37b4 | ||
|
2f4dd1462a | ||
|
a5680a6642 | ||
|
be6d2cc1df | ||
|
0a72be43da | ||
|
72fe50e2af | ||
|
aca951f8f5 | ||
|
0978a0678a | ||
|
c2905fbd8c | ||
|
7d7a22a682 | ||
|
89bf6c030f | ||
|
e1a45f6e54 | ||
|
535130561a | ||
|
4b640abb3a | ||
|
b7ad32e4f5 | ||
|
2a96a96c9c | ||
|
a3ea951e65 | ||
|
476e707f24 | ||
|
e29c9db4aa | ||
|
7fa3798e58 | ||
|
ba827041a4 | ||
|
0950af0d7c | ||
|
5f62bc0532 | ||
|
d0dafecc74 |
@ -1,2 +1,12 @@
|
||||
/coverage
|
||||
/node_modules
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@ -0,0 +1,3 @@
|
||||
/dist/**
|
||||
/coverage/**
|
||||
/node_modules/**
|
@ -1,18 +1,19 @@
|
||||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es2021": true,
|
||||
"jest/globals": true
|
||||
"es6": true,
|
||||
"jest": true
|
||||
},
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"plugin:prettier/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": "latest",
|
||||
"ecmaVersion": 2023,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,3 +1,5 @@
|
||||
/.yarn/releases/** binary
|
||||
/.yarn/plugins/** binary
|
||||
/__tests__/fixtures/** -linguist-detectable
|
||||
/dist/** 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: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
versioning-strategy: "increase"
|
||||
allow:
|
||||
- dependency-type: "production"
|
||||
labels:
|
||||
|
418
.github/workflows/ci.yml
vendored
418
.github/workflows/ci.yml
vendored
@ -1,8 +1,12 @@
|
||||
name: ci
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 */4 * * *' # every 4 hours
|
||||
- cron: '0 10 * * *'
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
@ -10,20 +14,42 @@ on:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
|
||||
env:
|
||||
DOCKER_IMAGE: localhost:5000/name/app
|
||||
BUILDX_VERSION: latest
|
||||
|
||||
jobs:
|
||||
context:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
context:
|
||||
- workflow
|
||||
- git
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
context: ${{ matrix.context }}
|
||||
|
||||
multi-images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -37,6 +63,9 @@ jobs:
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
type=sha
|
||||
-
|
||||
name: Print envs
|
||||
run: env|sort
|
||||
|
||||
tag-schedule:
|
||||
runs-on: ubuntu-latest
|
||||
@ -51,7 +80,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -81,7 +116,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -109,7 +150,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -134,7 +181,13 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -146,12 +199,39 @@ jobs:
|
||||
prefix=foo-
|
||||
suffix=-bar
|
||||
|
||||
labels:
|
||||
images:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
with:
|
||||
images: |
|
||||
name=${{ env.DOCKER_IMAGE }}
|
||||
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
||||
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
|
||||
custom-labels-annotations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
uses: ./
|
||||
@ -164,13 +244,53 @@ jobs:
|
||||
org.opencontainers.image.title=MyCustomTitle
|
||||
org.opencontainers.image.description=this is a "good" example
|
||||
org.opencontainers.image.vendor=MyCompany
|
||||
annotations: |
|
||||
maintainer=Foo
|
||||
org.opencontainers.image.title=MyFooTitle
|
||||
org.opencontainers.image.description=this is a "foo" example
|
||||
org.opencontainers.image.vendor=MyFooCompany
|
||||
|
||||
global-exps:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
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
|
||||
labels: |
|
||||
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
||||
tags: |
|
||||
type=sha
|
||||
type=raw,value=gexp-branch-{{branch}}
|
||||
type=raw,value=gexp-date-{{date 'YYYYMMDD'}}
|
||||
type=raw,value=gexp-tag-{{tag}}
|
||||
type=raw,value=gexp-baseref-{{base_ref}}
|
||||
type=raw,value=gexp-defbranch,enable={{is_default_branch}}
|
||||
|
||||
json:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver: docker
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
@ -199,13 +319,20 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
driver-opts: network=host
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
uses: ./
|
||||
with:
|
||||
images: ${{ env.DOCKER_IMAGE }}
|
||||
images: |
|
||||
${{ env.DOCKER_IMAGE }}
|
||||
tags: |
|
||||
type=schedule
|
||||
type=ref,event=branch
|
||||
@ -215,17 +342,9 @@ jobs:
|
||||
type=semver,pattern=v{{major}}.{{minor}}
|
||||
type=semver,pattern=v{{major}}
|
||||
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
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: ./test
|
||||
file: ./test/Dockerfile
|
||||
@ -242,17 +361,18 @@ jobs:
|
||||
name: Check manifest
|
||||
run: |
|
||||
docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
|
||||
-
|
||||
name: Dump context
|
||||
if: always()
|
||||
uses: crazy-max/ghaction-dump-context@v1
|
||||
|
||||
bake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
version: ${{ env.BUILDX_VERSION }}
|
||||
-
|
||||
name: Docker meta
|
||||
id: docker_meta
|
||||
@ -270,18 +390,244 @@ jobs:
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
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
|
||||
uses: docker/bake-action@v1
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
${{ steps.docker_meta.outputs.bake-file }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||
targets: |
|
||||
release
|
||||
|
||||
sep-tags:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sep:
|
||||
- " "
|
||||
- ","
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
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@v7
|
||||
with:
|
||||
script: |
|
||||
console.log(`${{ steps.meta.outputs.tags }}`);
|
||||
|
||||
output-env:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
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@v4
|
||||
-
|
||||
name: Dump context
|
||||
uses: crazy-max/ghaction-dump-context@v2
|
||||
|
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@v4
|
||||
-
|
||||
name: Publish
|
||||
uses: actions/publish-immutable-action@v0.0.4
|
20
.github/workflows/test.yml
vendored
20
.github/workflows/test.yml
vendored
@ -1,34 +1,28 @@
|
||||
name: test
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'releases/v*'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v1
|
||||
with:
|
||||
targets: validate
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v1
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
file: ./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@v4
|
||||
-
|
||||
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
|
||||
node_modules/
|
||||
lib
|
||||
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||
|
||||
# Jetbrains
|
||||
/.idea
|
||||
/*.iml
|
||||
|
||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
@ -14,6 +7,7 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
@ -24,34 +18,14 @@ pids
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
@ -61,36 +35,19 @@ typings/
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
# dotenv environment variable files
|
||||
.env
|
||||
.env.test
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.env.local
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
6
.prettierignore
Normal file
6
.prettierignore
Normal file
@ -0,0 +1,6 @@
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# yarn v2
|
||||
.yarn/
|
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
13
.yarnrc.yml
Normal file
13
.yarnrc.yml
Normal file
@ -0,0 +1,13 @@
|
||||
logFilters:
|
||||
- code: YN0013
|
||||
level: discard
|
||||
- code: YN0019
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
plugins:
|
||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||
spec: "@yarnpkg/plugin-interactive-tools"
|
600
README.md
600
README.md
@ -1,12 +1,14 @@
|
||||
[](https://github.com/docker/metadata-action/releases/latest)
|
||||
[](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)
|
||||
|
||||
## About
|
||||
|
||||
GitHub Action to extract metadata from Git reference and GitHub events.
|
||||
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.
|
||||
GitHub Action to extract metadata from Git reference and GitHub events. 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.
|
||||
|
||||

|
||||
|
||||
@ -19,6 +21,9 @@ ___
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [outputs](#outputs)
|
||||
* [environment variables](#environment-variables)
|
||||
* [`context` input](#context-input)
|
||||
* [`images` input](#images-input)
|
||||
* [`flavor` input](#flavor-input)
|
||||
* [`tags` input](#tags-input)
|
||||
* [`type=schedule`](#typeschedule)
|
||||
@ -30,12 +35,22 @@ ___
|
||||
* [`type=raw`](#typeraw)
|
||||
* [`type=sha`](#typesha)
|
||||
* [Notes](#notes)
|
||||
* [Image name and tag sanitization](#image-name-and-tag-sanitization)
|
||||
* [Latest tag](#latest-tag)
|
||||
* [`priority` attribute](#priority-attribute)
|
||||
* [Global expressions](#global-expressions)
|
||||
* [`{{branch}}`](#branch)
|
||||
* [`{{tag}}`](#tag)
|
||||
* [`{{sha}}`](#sha)
|
||||
* [`{{base_ref}}`](#base_ref)
|
||||
* [`{{is_default_branch}}`](#is_default_branch)
|
||||
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
||||
* [`{{commit_date '<format>' tz='<timezone>'}}`](#commit_date-format-tztimezone)
|
||||
* [Major version zero](#major-version-zero)
|
||||
* [JSON output object](#json-output-object)
|
||||
* [Overwrite labels](#overwrite-labels)
|
||||
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
|
||||
* [Overwrite labels and annotations](#overwrite-labels-and-annotations)
|
||||
* [Annotations](#annotations)
|
||||
* [Contributing](#contributing)
|
||||
|
||||
## Usage
|
||||
|
||||
@ -45,6 +60,7 @@ ___
|
||||
name: ci
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
@ -60,23 +76,23 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@ -84,13 +100,14 @@ jobs:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
```
|
||||
|
||||
| Event | Ref | Docker Tags |
|
||||
|-----------------|-------------------------------|-------------------------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||
| `push` | `refs/heads/master` | `master` |
|
||||
| `push` | `refs/heads/releases/v1` | `releases-v1` |
|
||||
| `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` |
|
||||
| Event | Ref | Docker Tags |
|
||||
|---------------------|-------------------------------|----------------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||
| `push` | `refs/heads/master` | `master` |
|
||||
| `push` | `refs/heads/releases/v1` | `releases-v1` |
|
||||
| `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` |
|
||||
| `workflow_dispatch` | `refs/heads/master` | `master` |
|
||||
|
||||
### Semver
|
||||
|
||||
@ -113,13 +130,14 @@ jobs:
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
images: |
|
||||
name/app
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
@ -128,13 +146,13 @@ jobs:
|
||||
-
|
||||
name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
@ -153,8 +171,8 @@ jobs:
|
||||
### Bake definition
|
||||
|
||||
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-metadata-action` and inherit from it.
|
||||
[Docker Bake action](https://github.com/docker/bake-action). You just have to
|
||||
declare an empty target named `docker-metadata-action` and inherit from it.
|
||||
|
||||
```hcl
|
||||
// docker-bake.hcl
|
||||
@ -188,15 +206,13 @@ jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
images: |
|
||||
name/app
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
@ -205,15 +221,16 @@ jobs:
|
||||
type=sha
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v1
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
cwd://${{ steps.meta.outputs.bake-file }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with `refs/tags/v1.2.3` ref:
|
||||
Content of `${{ steps.meta.outputs.bake-file }}` file, combining tags and
|
||||
labels, will look like this with `refs/tags/v1.2.3` ref:
|
||||
|
||||
```json
|
||||
{
|
||||
@ -232,7 +249,7 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with `
|
||||
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
||||
"org.opencontainers.image.version": "1.2.3",
|
||||
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
||||
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
|
||||
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||
"org.opencontainers.image.licenses": "MIT"
|
||||
},
|
||||
"args": {
|
||||
@ -244,11 +261,27 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with `
|
||||
}
|
||||
```
|
||||
|
||||
You can also use the `bake-file-tags` and `bake-file-labels` outputs if you
|
||||
just want to use tags and/or labels respectively. The following example is
|
||||
similar to the previous one:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-labels }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
## Customizing
|
||||
|
||||
### inputs
|
||||
|
||||
Following inputs can be used as `step.with` keys
|
||||
The following inputs can be used as `step.with` keys:
|
||||
|
||||
> `List` type is a newline-delimited string
|
||||
> ```yaml
|
||||
@ -258,32 +291,101 @@ Following inputs can be used as `step.with` keys
|
||||
> org.opencontainers.image.vendor=MyCompany
|
||||
> ```
|
||||
|
||||
> `CSV` type is a comma-delimited string
|
||||
> ```yaml
|
||||
> images: name/app,ghcr.io/name/app
|
||||
> ```
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------------|----------|------------------------------------|
|
||||
| `images` | List/CSV | List of Docker images to use as base name for tags |
|
||||
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||
| `labels` | List | List of custom labels |
|
||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
||||
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||
| Name | Type | Description |
|
||||
|-------------------|--------|------------------------------------------------------------------------------|
|
||||
| `context` | String | Where to get context data. Allowed options are: `workflow` (default), `git`. |
|
||||
| `images` | List | List of Docker images to use as base name for tags |
|
||||
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||
| `labels` | List | List of custom labels |
|
||||
| `annotations` | List | List of custom annotations |
|
||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
||||
| `sep-annotations` | String | Separator to use for annotations output (default `\n`) |
|
||||
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||
|
||||
### outputs
|
||||
|
||||
Following outputs are available
|
||||
The following outputs are available:
|
||||
|
||||
| Name | Type | Description |
|
||||
|---------------|---------|---------------------------------------|
|
||||
| `version` | String | Docker image version |
|
||||
| `tags` | String | Docker tags |
|
||||
| `labels` | String | Docker labels |
|
||||
| `json` | String | JSON output of tags and labels |
|
||||
| `bake-file` | File | [Bake definition file](https://github.com/docker/buildx#file-definition) path |
|
||||
| Name | Type | Description |
|
||||
|-------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `version` | String | Docker image version |
|
||||
| `tags` | String | Docker tags |
|
||||
| `labels` | String | Docker labels |
|
||||
| `annotations` | String | [Annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||
| `json` | String | JSON output of tags and labels |
|
||||
| `bake-file-tags` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with tags |
|
||||
| `bake-file-labels` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with labels |
|
||||
| `bake-file-annotations` | File | [Bake file definition](https://docs.docker.com/build/bake/reference/) path with [annotations](https://github.com/moby/buildkit/blob/master/docs/annotations.md) |
|
||||
|
||||
Alternatively, each output is also exported as an environment variable 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` defines a list of Docker images to use as base name for [`tags`](#tags-input):
|
||||
|
||||
```yaml
|
||||
images: |
|
||||
name/foo
|
||||
ghcr.io/name/bar
|
||||
# or
|
||||
name=name/foo
|
||||
name=ghcr.io/name/bar
|
||||
```
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
```yaml
|
||||
images: |
|
||||
name=,enable=true
|
||||
```
|
||||
|
||||
* `name=<string>` image base name
|
||||
* `enable=<true|false>` enable this entry (default `true`)
|
||||
|
||||
If `images` is empty, tags will be generated without base name.
|
||||
|
||||
## `flavor` input
|
||||
|
||||
@ -297,13 +399,16 @@ flavor: |
|
||||
```
|
||||
|
||||
* `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`
|
||||
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated tag and optionally for `latest`
|
||||
* `prefix=<string>,onlatest=<true|false>`: A global prefix for each generated
|
||||
tag and optionally for `latest`
|
||||
* `suffix=<string>,onlatest=<true|false>`: A global suffix for each generated
|
||||
tag and optionally for `latest`
|
||||
|
||||
## `tags` input
|
||||
|
||||
`tags` is the core input of this action as everything related to it will 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
|
||||
`tags` is the core input of this action as everything related to it will
|
||||
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:
|
||||
|
||||
```yaml
|
||||
@ -331,7 +436,7 @@ Each entry is defined by a `type`, which are:
|
||||
And global attributes:
|
||||
|
||||
* `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
|
||||
* `suffix=<string>` add suffix
|
||||
|
||||
@ -355,18 +460,23 @@ tags: |
|
||||
type=schedule,pattern=nightly
|
||||
# handlebars
|
||||
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
|
||||
the following expressions:
|
||||
* `date 'format'` ; render date by its [moment format](https://momentjs.com/docs/#/displaying/format/)
|
||||
`pattern` is a specially crafted attribute to support [Handlebars' template](https://handlebarsjs.com/guide/)
|
||||
with the following expressions:
|
||||
|
||||
| Pattern | Output |
|
||||
|--------------------------|----------------------|
|
||||
| `nightly` | `nightly` |
|
||||
| `{{date 'YYYYMMDD'}}` | `20210326` |
|
||||
* `date 'format' tz='Timezone'` ; render date by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||
Default `tz` is UTC.
|
||||
|
||||
| Pattern | Output |
|
||||
|----------------------------------------------|-------------------|
|
||||
| `nightly` | `nightly` |
|
||||
| `{{date 'YYYYMMDD'}}` | `20200110` |
|
||||
| `{{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -385,11 +495,13 @@ tags: |
|
||||
type=semver,pattern={{version}},value=v1.0.0
|
||||
```
|
||||
|
||||
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/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`
|
||||
attribute.
|
||||
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` 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
|
||||
* `version` ; shorthand for `{{major}}.{{minor}}.{{patch}}` (can include pre-release)
|
||||
* `major` ; major version identifier
|
||||
@ -408,9 +520,10 @@ attribute.
|
||||
| `v2.0.8-beta.67` | `{{version}}` | `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
|
||||
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
|
||||
> not yet fit for public consumption.
|
||||
> *Pre-release (rc, beta, alpha) will only extend `{{version}}` (or `{{raw}}`
|
||||
> if specified) as tag because they are updated frequently, and contain many
|
||||
> breaking changes that are (by the author's design) not yet fit for public
|
||||
> consumption.
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -429,11 +542,13 @@ tags: |
|
||||
type=pep440,pattern={{version}},value=1.0.0
|
||||
```
|
||||
|
||||
Will be used on a [push tag event](https://docs.github.com/en/actions/reference/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
|
||||
custom value through `value` attribute.
|
||||
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 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
|
||||
* `version` ; cleaned version
|
||||
* `major` ; major version identifier
|
||||
@ -454,9 +569,10 @@ custom value through `value` attribute.
|
||||
| `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
|
||||
> because they are updated frequently, and contain many breaking changes that are (by the author's design)
|
||||
> not yet fit for public consumption.
|
||||
> *dev/pre/post release will only extend `{{version}}` (or `{{raw}}` if
|
||||
> specified) as tag because they are updated frequently, and contain many
|
||||
> breaking changes that are (by the author's design) not yet fit for public
|
||||
> consumption.
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -477,17 +593,17 @@ tags: |
|
||||
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
|
||||
[push tag event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push) but, you can also use
|
||||
a custom value through `value` attribute.
|
||||
Can create a regular expression for matching Git tag with a pattern and
|
||||
capturing group. Will be used on a [push tag event](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
|
||||
but, you can also use a custom value through `value` attribute.
|
||||
|
||||
| Git tag | Pattern | Group | Output |
|
||||
|-------------------------|-------------------------------|---------|------------------------|
|
||||
| `v1.2.3` | `\d.\d.\d` | `0` | `1.2.3` |
|
||||
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
|
||||
| `v2.0.8-beta.67` | `v(\d.\d)` | `1` | `2.0` |
|
||||
| `20200110-RC2` | `\d+` | `0` | `20200110` |
|
||||
| `p1/v1.2.3` | `p1-v(\d.\d.\d)` | `1` | `1.2.3` |
|
||||
| Git tag | Pattern | Group | Output |
|
||||
|-------------------------|------------------|---------|------------------------|
|
||||
| `v1.2.3` | `\d.\d.\d` | `0` | `1.2.3` |
|
||||
| `v2.0.8-beta.67` | `v(.*)` | `1` | `2.0.8-beta.67` |
|
||||
| `v2.0.8-beta.67` | `v(\d.\d)` | `1` | `2.0` |
|
||||
| `20200110-RC2` | `\d+` | `0` | `20200110` |
|
||||
| `p1/v1.2.3` | `p1/v(\d.\d.\d)` | `1` | `1.2.3` |
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -506,9 +622,9 @@ tags: |
|
||||
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`
|
||||
as a Docker tag for a better distinction or common pattern. This is also used by official images
|
||||
like [Alpine](https://hub.docker.com/_/alpine).
|
||||
An `edge` tag reflects the last commit of the active branch on your Git
|
||||
repository. I usually prefer to use `edge` as a Docker tag for a better
|
||||
distinction or common pattern. This is also used by official images like [Alpine](https://hub.docker.com/_/alpine).
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -530,17 +646,19 @@ tags: |
|
||||
```
|
||||
|
||||
This type handles Git ref (or reference) for the following events:
|
||||
|
||||
* `branch` ; eg. `refs/heads/master`
|
||||
* `tag` ; eg. `refs/tags/v1.0.0`
|
||||
* `pr` ; eg. `refs/pull/318/merge`
|
||||
|
||||
| Event | Ref | Output |
|
||||
|-----------------|-------------------------------|-------------------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||
| `push` | `refs/heads/master` | `master` |
|
||||
| `push` | `refs/heads/my/branch` | `my-branch` |
|
||||
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3` |
|
||||
| `push tag` | `refs/tags/v2.0.8-beta.67` | `v2.0.8-beta.67` |
|
||||
| Event | Ref | Output |
|
||||
|---------------------|-------------------------------|------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | `pr-2` |
|
||||
| `push` | `refs/heads/master` | `master` |
|
||||
| `push` | `refs/heads/my/branch` | `my-branch` |
|
||||
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3` |
|
||||
| `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:
|
||||
|
||||
@ -587,7 +705,26 @@ tags: |
|
||||
type=sha,format=long
|
||||
```
|
||||
|
||||
Output Git short commit (or long if specified) as Docker tag like `sha-ad132f5`.
|
||||
Output Git short commit (or long if specified) as Docker tag like
|
||||
`sha-860c190`.
|
||||
|
||||
By default, the length of the short commit SHA is `7` characters. You can
|
||||
increase this length for larger repositories by setting the
|
||||
[`DOCKER_METADATA_SHORT_SHA_LENGTH` environment variable](#environment-variables):
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
name/app
|
||||
tags: |
|
||||
type=sha
|
||||
env:
|
||||
DOCKER_METADATA_SHORT_SHA_LENGTH: 12
|
||||
```
|
||||
|
||||
Extended attributes and default values:
|
||||
|
||||
@ -598,33 +735,73 @@ tags: |
|
||||
|
||||
## Notes
|
||||
|
||||
### Image name and tag sanitization
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
A tag name must be a valid ASCII chars sequences and may contain lowercase and
|
||||
uppercase letters, digits, underscores, periods and dashes. A tag name may not
|
||||
start with a period or a dash and may contain a maximum of 128 characters.
|
||||
|
||||
To ease the integration in your workflow, this action will automatically:
|
||||
|
||||
* Lowercase the image name
|
||||
* Replace invalid chars sequences with `-` for tags
|
||||
|
||||
### 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=semver,pattern=...`](#typesemver)
|
||||
* [`type=pep440,pattern=...`](#typepep440)
|
||||
* [`type=match,pattern=...`](#typematch)
|
||||
|
||||
For conditionally tagging with latest for a specific branch name, e.g. if your default branch name
|
||||
is not `master`, use `type=raw` with a boolean expression:
|
||||
For conditionally tagging with latest for a specific branch name, e.g. if your
|
||||
default branch name is not `master`, use `type=raw` with a boolean expression:
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
||||
# set latest tag for master branch
|
||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
|
||||
```
|
||||
|
||||
You can also use the [`{{is_default_branch}}` global expression](#is_default_branch)
|
||||
to conditionally tag with latest for the default branch:
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
# set latest tag for 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
|
||||
|
||||
The following [Handlebars' template](https://handlebarsjs.com/guide/) expressions for `prefix`, `suffix` and `value`
|
||||
attributes are available:
|
||||
|
||||
| Expression | Output |
|
||||
|--------------------------|----------------------|
|
||||
| `{{branch}}` | `master` |
|
||||
| `{{tag}}` | `v1.2.3` |
|
||||
| `{{sha}}` | `90dd603` |
|
||||
| `{{base_ref}}` | `master` |
|
||||
| `{{date 'YYYYMMDD'}}` | `20210326` |
|
||||
The following [Handlebars' template](https://handlebarsjs.com/guide/) expressions
|
||||
for `prefix`, `suffix`, `value` and `enable` attributes of `tags` input are
|
||||
available:
|
||||
|
||||
```yaml
|
||||
tags: |
|
||||
@ -634,13 +811,96 @@ tags: |
|
||||
type=raw,value=mytag-{{branch}}-{{sha}}
|
||||
```
|
||||
|
||||
They can also be applied to `labels` and `annotations` inputs:
|
||||
|
||||
```yaml
|
||||
labels: |
|
||||
org.opencontainers.image.created={{commit_date 'YYYY-MM-DDTHH:mm:ss.SSS[Z]'}}
|
||||
```
|
||||
|
||||
#### `{{branch}}`
|
||||
|
||||
Returns the branch name that triggered the workflow run. Will be empty if not
|
||||
a branch reference:
|
||||
|
||||
| Event | Ref | Output |
|
||||
|----------------|------------------------|-------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | |
|
||||
| `push` | `refs/heads/master` | `master` |
|
||||
| `push` | `refs/heads/my/branch` | `my-branch` |
|
||||
| `push tag` | `refs/tags/v1.2.3` | |
|
||||
|
||||
#### `{{tag}}`
|
||||
|
||||
Returns the tag name that triggered the workflow run. Will be empty if not a
|
||||
tag reference:
|
||||
|
||||
| Event | Ref | Output |
|
||||
|-----------------|-------------------------------|--------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | |
|
||||
| `push` | `refs/heads/master` | |
|
||||
| `push` | `refs/heads/my/branch` | |
|
||||
| `push tag` | `refs/tags/v1.2.3` | `v1.2.3` |
|
||||
|
||||
#### `{{sha}}`
|
||||
|
||||
Returns the short commit SHA that triggered the workflow run (e.g., `90dd603`).
|
||||
|
||||
#### `{{base_ref}}`
|
||||
|
||||
Returns the base ref or target branch of the pull request that triggered the
|
||||
workflow run. Will be empty for a branch reference:
|
||||
|
||||
| Event | Ref | Output |
|
||||
|----------------|-------------------------------|--------------------|
|
||||
| `pull_request` | `refs/pull/2/merge` | `master` |
|
||||
| `push` | `refs/heads/master` | |
|
||||
| `push` | `refs/heads/my/branch` | |
|
||||
| `push tag`* | `refs/tags/v1.2.3` | `master` |
|
||||
|
||||
> *`base_ref` is available in the push payload but doesn't always seem to
|
||||
> return the expected branch when the push tag event occurs. It's also
|
||||
> [not documented in GitHub docs](https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#push).
|
||||
> We keep it for backward compatibility, but it's **not recommended relying on it**.
|
||||
> More context in [#192](https://github.com/docker/metadata-action/pull/192#discussion_r854673012).
|
||||
|
||||
#### `{{is_default_branch}}`
|
||||
|
||||
Returns `true` if the branch that triggered the workflow run is the default
|
||||
one, otherwise `false`.
|
||||
|
||||
#### `{{date '<format>' tz='<timezone>'}}`
|
||||
|
||||
Returns the current date rendered by its [moment format](https://momentjs.com/docs/#/displaying/format/).
|
||||
Default `tz` is UTC.
|
||||
|
||||
| Expression | Output example |
|
||||
|----------------------------------------------|-----------------------------------------|
|
||||
| `{{date 'YYYYMMDD'}}` | `20200110` |
|
||||
| `{{date 'dddd, MMMM Do YYYY, h:mm:ss a'}}` | `Friday, January 10th 2020, 3:25:50 pm` |
|
||||
| `{{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||
|
||||
#### `{{commit_date '<format>' tz='<timezone>'}}`
|
||||
|
||||
Returns the date when the current git commit is committed, rendered by its
|
||||
[moment format](https://momentjs.com/docs/#/displaying/format/). It falls back
|
||||
to the current date if the commit date is not available.
|
||||
|
||||
Default `tz` is UTC.
|
||||
|
||||
| Expression | Output example |
|
||||
|-----------------------------------------------------|-----------------------------------------|
|
||||
| `{{commit_date 'YYYYMMDD'}}` | `20200110` |
|
||||
| `{{commit_date 'dddd, MMMM Do YYYY, h:mm:ss a'}}` | `Friday, January 10th 2020, 3:25:50 pm` |
|
||||
| `{{commit_date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}` | `20200110-093000` |
|
||||
|
||||
### Major version zero
|
||||
|
||||
Major version zero (`0.y.z`) is for initial development and **may** change at any time. This means the public API
|
||||
[**should not** be considered stable](https://semver.org/#spec-item-4).
|
||||
Major version zero (`0.y.z`) is for initial development and **may** change at
|
||||
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}}`
|
||||
pattern. You can manage this behavior like this:
|
||||
In this case, Docker tag `0` **should not** be generated if you're using [`type=semver`](#typesemver)
|
||||
with `{{major}}` pattern. You can manage this behavior like this:
|
||||
|
||||
```yaml
|
||||
# refs/tags/v0.1.2
|
||||
@ -655,19 +915,19 @@ tags: |
|
||||
|
||||
### 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
|
||||
workflow using the [`fromJSON` function](https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson):
|
||||
The `json` output is a JSON object composed of the generated tags and labels so
|
||||
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
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@ -677,16 +937,17 @@ workflow using the [`fromJSON` function](https://docs.github.com/en/actions/lear
|
||||
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||
```
|
||||
|
||||
### Overwrite labels
|
||||
### Overwrite labels and annotations
|
||||
|
||||
If some [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
|
||||
labels generated are not suitable, you can overwrite them like this:
|
||||
generated are not suitable as labels/annotations, you can overwrite them like
|
||||
this:
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
labels: |
|
||||
@ -696,18 +957,79 @@ labels generated are not suitable, you can overwrite them like this:
|
||||
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)
|
||||
has [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),
|
||||
to enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:
|
||||
Since Buildx 0.12, it is possible to set annotations to your image through the
|
||||
`--annotation` flag.
|
||||
|
||||
With the [`build-push-action`](https://github.com/docker/build-push-action/),
|
||||
you can set the `annotations` input with the value of the `annotations` output
|
||||
of the `metadata-action`:
|
||||
|
||||
```yaml
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
```
|
||||
|
||||
The same can be done with the [`bake-action`](https://github.com/docker/bake-action/):
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v6
|
||||
with:
|
||||
files: |
|
||||
./docker-bake.hcl
|
||||
cwd://${{ steps.meta.outputs.bake-file-tags }}
|
||||
cwd://${{ steps.meta.outputs.bake-file-annotations }}
|
||||
targets: build
|
||||
```
|
||||
|
||||
Note that annotations can be attached at many different levels within a manifest.
|
||||
By default, the generated annotations will be attached to image manifests,
|
||||
but different registries may expect annotations at different places;
|
||||
a common practice is to read annotations at _image indexes_ if present,
|
||||
which are often used by multi-arch builds to index platform-specific images.
|
||||
If you want to specify level(s) for your annotations, you can use the
|
||||
[`DOCKER_METADATA_ANNOTATIONS_LEVELS` environment variable](#environment-variables)
|
||||
with a comma separated list of all levels the annotations should be attached to (defaults to `manifest`).
|
||||
The following configuration demonstrates the ability to attach annotations to both image manifests and image indexes,
|
||||
though your registry may only need annotations at the index level. (That is, `index` alone may be enough.)
|
||||
Please consult the documentation of your registry.
|
||||
|
||||
```yaml
|
||||
-
|
||||
name: Docker meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: name/app
|
||||
env:
|
||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
annotations: ${{ steps.meta.outputs.annotations }}
|
||||
```
|
||||
|
||||
More information about annotations in the [BuildKit documentation](https://github.com/moby/buildkit/blob/master/docs/annotations.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to contribute? Awesome! You can find information about contributing to
|
||||
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@v3`
|
||||
* 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@v3
|
||||
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@v3
|
||||
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 os from 'os';
|
||||
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 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;
|
||||
});
|
||||
const toolkit = new Toolkit({githubToken: 'fake-github-token'});
|
||||
|
||||
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'
|
||||
]);
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
|
||||
return new Context();
|
||||
});
|
||||
});
|
||||
|
||||
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', () => {
|
||||
describe('getInputs', () => {
|
||||
beforeEach(() => {
|
||||
process.stdout.write = jest.fn() as typeof process.stdout.write;
|
||||
process.env = Object.keys(process.env).reduce((object, key) => {
|
||||
if (!key.startsWith('INPUT_')) {
|
||||
object[key] = process.env[key];
|
||||
}
|
||||
return object;
|
||||
}, {});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('setOutput produces the correct command', () => {
|
||||
context.setOutput('some output', 'some value');
|
||||
assertWriteCalls([`::set-output name=some output::some value${os.EOL}`]);
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
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);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('getContext', () => {
|
||||
const originalEnv = process.env;
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = {
|
||||
...originalEnv,
|
||||
...dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures/event_create_branch.env')))
|
||||
};
|
||||
});
|
||||
afterEach(() => {
|
||||
process.env = originalEnv;
|
||||
});
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('setOutput handles bools', () => {
|
||||
context.setOutput('some output', false);
|
||||
assertWriteCalls([`::set-output name=some output::false${os.EOL}`]);
|
||||
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'));
|
||||
});
|
||||
|
||||
// eslint-disable-next-line jest/expect-expect
|
||||
it('setOutput handles numbers', () => {
|
||||
context.setOutput('some output', 1.01);
|
||||
assertWriteCalls([`::set-output name=some output::1.01${os.EOL}`]);
|
||||
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 {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
30
__tests__/fixtures/event_create_branch.env
Normal file
30
__tests__/fixtures/event_create_branch.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_49ba9b4e-1733-447c-b700-1cea19f95b82
|
||||
GITHUB_EVENT_NAME=create
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_create_branch.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_49ba9b4e-1733-447c-b700-1cea19f95b82
|
||||
GITHUB_REF=refs/heads/dev
|
||||
GITHUB_REF_NAME=dev
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188731929
|
||||
GITHUB_RUN_NUMBER=14
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=5f3331d7f7044c18ca9f12c77d961c4d7cf3276a
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_49ba9b4e-1733-447c-b700-1cea19f95b82
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
145
__tests__/fixtures/event_create_branch.json
Normal file
145
__tests__/fixtures/event_create_branch.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"description": "Test \"Docker\" Actions",
|
||||
"master_branch": "master",
|
||||
"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_type": "user",
|
||||
"ref": "dev",
|
||||
"ref_type": "branch",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:24:14Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
30
__tests__/fixtures/event_create_tag.env
Normal file
30
__tests__/fixtures/event_create_tag.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_06751acb-da10-4e54-916a-60749556fc8b
|
||||
GITHUB_EVENT_NAME=create
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_create_tag.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_06751acb-da10-4e54-916a-60749556fc8b
|
||||
GITHUB_REF=refs/tags/v2.1.8-beta.67
|
||||
GITHUB_REF_NAME=v2.1.8-beta.67
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815957
|
||||
GITHUB_RUN_NUMBER=22
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_06751acb-da10-4e54-916a-60749556fc8b
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
145
__tests__/fixtures/event_create_tag.json
Normal file
145
__tests__/fixtures/event_create_tag.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"description": "Test \"Docker\" Actions",
|
||||
"master_branch": "master",
|
||||
"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_type": "user",
|
||||
"ref": "v2.1.8-beta.67",
|
||||
"ref_type": "tag",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:41:03Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
30
__tests__/fixtures/event_discussion_created.env
Normal file
30
__tests__/fixtures/event_discussion_created.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_5f8f9da1-1c58-4a8e-bef4-dba436a05edf
|
||||
GITHUB_EVENT_NAME=discussion
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_discussion_created.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_5f8f9da1-1c58-4a8e-bef4-dba436a05edf
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188642055
|
||||
GITHUB_RUN_NUMBER=7
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=266574110acf203503badf966df2ea24b5d732d7
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_5f8f9da1-1c58-4a8e-bef4-dba436a05edf
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
205
__tests__/fixtures/event_discussion_created.json
Normal file
205
__tests__/fixtures/event_discussion_created.json
Normal file
@ -0,0 +1,205 @@
|
||||
{
|
||||
"action": "created",
|
||||
"discussion": {
|
||||
"active_lock_reason": null,
|
||||
"answer_chosen_at": null,
|
||||
"answer_chosen_by": null,
|
||||
"answer_html_url": null,
|
||||
"author_association": "COLLABORATOR",
|
||||
"body": "bar",
|
||||
"category": {
|
||||
"created_at": "2022-04-19T11:05:12.000+02:00",
|
||||
"description": "Chat about anything and everything here",
|
||||
"emoji": ":speech_balloon:",
|
||||
"id": 37396924,
|
||||
"is_answerable": false,
|
||||
"name": "General",
|
||||
"node_id": "DIC_kwDOEQjNNc4COqG8",
|
||||
"repository_id": 285789493,
|
||||
"slug": "general",
|
||||
"updated_at": "2022-04-19T11:05:12.000+02:00"
|
||||
},
|
||||
"comments": 0,
|
||||
"created_at": "2022-04-19T09:07:32Z",
|
||||
"html_url": "https://github.com/docker/test-docker-action/discussions/13",
|
||||
"id": 4019118,
|
||||
"locked": false,
|
||||
"node_id": "D_kwDOEQjNNc4APVOu",
|
||||
"number": 13,
|
||||
"reactions": {
|
||||
"+1": 0,
|
||||
"-1": 0,
|
||||
"confused": 0,
|
||||
"eyes": 0,
|
||||
"heart": 0,
|
||||
"hooray": 0,
|
||||
"laugh": 0,
|
||||
"rocket": 0,
|
||||
"total_count": 0,
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/discussions/13/reactions"
|
||||
},
|
||||
"repository_url": "https://api.github.com/repos/docker/test-docker-action",
|
||||
"state": "open",
|
||||
"timeline_url": "https://api.github.com/repos/docker/test-docker-action/discussions/13/timeline",
|
||||
"title": "foo",
|
||||
"updated_at": "2022-04-19T09:07:32Z",
|
||||
"user": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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": 4,
|
||||
"open_issues_count": 4,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:04:50Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
30
__tests__/fixtures/event_discussion_pinned.env
Normal file
30
__tests__/fixtures/event_discussion_pinned.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_940c04a5-537a-4401-afe6-1f044e1d3836
|
||||
GITHUB_EVENT_NAME=discussion
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_discussion_pinned.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_940c04a5-537a-4401-afe6-1f044e1d3836
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188642074
|
||||
GITHUB_RUN_NUMBER=8
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=266574110acf203503badf966df2ea24b5d732d7
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_940c04a5-537a-4401-afe6-1f044e1d3836
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
205
__tests__/fixtures/event_discussion_pinned.json
Normal file
205
__tests__/fixtures/event_discussion_pinned.json
Normal file
@ -0,0 +1,205 @@
|
||||
{
|
||||
"action": "pinned",
|
||||
"discussion": {
|
||||
"active_lock_reason": null,
|
||||
"answer_chosen_at": null,
|
||||
"answer_chosen_by": null,
|
||||
"answer_html_url": null,
|
||||
"author_association": "COLLABORATOR",
|
||||
"body": "bar",
|
||||
"category": {
|
||||
"created_at": "2022-04-19T11:05:12.000+02:00",
|
||||
"description": "Chat about anything and everything here",
|
||||
"emoji": ":speech_balloon:",
|
||||
"id": 37396924,
|
||||
"is_answerable": false,
|
||||
"name": "General",
|
||||
"node_id": "DIC_kwDOEQjNNc4COqG8",
|
||||
"repository_id": 285789493,
|
||||
"slug": "general",
|
||||
"updated_at": "2022-04-19T11:05:12.000+02:00"
|
||||
},
|
||||
"comments": 0,
|
||||
"created_at": "2022-04-19T09:07:32Z",
|
||||
"html_url": "https://github.com/docker/test-docker-action/discussions/13",
|
||||
"id": 4019118,
|
||||
"locked": false,
|
||||
"node_id": "D_kwDOEQjNNc4APVOu",
|
||||
"number": 13,
|
||||
"reactions": {
|
||||
"+1": 0,
|
||||
"-1": 0,
|
||||
"confused": 0,
|
||||
"eyes": 0,
|
||||
"heart": 0,
|
||||
"hooray": 0,
|
||||
"laugh": 0,
|
||||
"rocket": 0,
|
||||
"total_count": 0,
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/discussions/13/reactions"
|
||||
},
|
||||
"repository_url": "https://api.github.com/repos/docker/test-docker-action",
|
||||
"state": "open",
|
||||
"timeline_url": "https://api.github.com/repos/docker/test-docker-action/discussions/13/timeline",
|
||||
"title": "foo",
|
||||
"updated_at": "2022-04-19T09:07:32Z",
|
||||
"user": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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": 4,
|
||||
"open_issues_count": 4,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:04:50Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
30
__tests__/fixtures/event_issue_opened.env
Normal file
30
__tests__/fixtures/event_issue_opened.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_b598b668-2cad-465a-b526-d21912b7d2b2
|
||||
GITHUB_EVENT_NAME=issues
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_issue_opened.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_b598b668-2cad-465a-b526-d21912b7d2b2
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188657159
|
||||
GITHUB_RUN_NUMBER=9
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=266574110acf203503badf966df2ea24b5d732d7
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_b598b668-2cad-465a-b526-d21912b7d2b2
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
200
__tests__/fixtures/event_issue_opened.json
Normal file
200
__tests__/fixtures/event_issue_opened.json
Normal file
@ -0,0 +1,200 @@
|
||||
{
|
||||
"action": "opened",
|
||||
"issue": {
|
||||
"active_lock_reason": null,
|
||||
"assignee": null,
|
||||
"assignees": [],
|
||||
"author_association": "COLLABORATOR",
|
||||
"body": "bar",
|
||||
"closed_at": null,
|
||||
"comments": 0,
|
||||
"comments_url": "https://api.github.com/repos/docker/test-docker-action/issues/14/comments",
|
||||
"created_at": "2022-04-19T09:10:26Z",
|
||||
"events_url": "https://api.github.com/repos/docker/test-docker-action/issues/14/events",
|
||||
"html_url": "https://github.com/docker/test-docker-action/issues/14",
|
||||
"id": 1208034626,
|
||||
"labels": [],
|
||||
"labels_url": "https://api.github.com/repos/docker/test-docker-action/issues/14/labels{/name}",
|
||||
"locked": false,
|
||||
"milestone": null,
|
||||
"node_id": "I_kwDOEQjNNc5IASVC",
|
||||
"number": 14,
|
||||
"performed_via_github_app": null,
|
||||
"reactions": {
|
||||
"+1": 0,
|
||||
"-1": 0,
|
||||
"confused": 0,
|
||||
"eyes": 0,
|
||||
"heart": 0,
|
||||
"hooray": 0,
|
||||
"laugh": 0,
|
||||
"rocket": 0,
|
||||
"total_count": 0,
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/issues/14/reactions"
|
||||
},
|
||||
"repository_url": "https://api.github.com/repos/docker/test-docker-action",
|
||||
"state": "open",
|
||||
"timeline_url": "https://api.github.com/repos/docker/test-docker-action/issues/14/timeline",
|
||||
"title": "foo",
|
||||
"updated_at": "2022-04-19T09:10:26Z",
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/issues/14",
|
||||
"user": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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": 5,
|
||||
"open_issues_count": 5,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:04:50Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=master
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_e00a951d-2585-4fac-b085-459d80e69a2f
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_ca953e95-2f41-4926-bc52-a1c8d90e94c1
|
||||
GITHUB_EVENT_NAME=pull_request
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_pull_request.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=pr
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_e00a951d-2585-4fac-b085-459d80e69a2f
|
||||
GITHUB_REF=refs/pull/2/merge
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_HEAD_REF=test-pr
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_ca953e95-2f41-4926-bc52-a1c8d90e94c1
|
||||
GITHUB_REF=refs/pull/15/merge
|
||||
GITHUB_REF_NAME=15/merge
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325972677
|
||||
GITHUB_RUN_NUMBER=7
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188688025
|
||||
GITHUB_RUN_NUMBER=11
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=1e9249f05bfc090e0688b8fb9c1b347586add504
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=a9c8c5828b91be19d9728548b24759e352367ef1
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_ca953e95-2f41-4926-bc52-a1c8d90e94c1
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,35 +1,49 @@
|
||||
{
|
||||
"action": "opened",
|
||||
"number": 7,
|
||||
"number": 15,
|
||||
"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"
|
||||
},
|
||||
"pull_request": {
|
||||
"_links": {
|
||||
"comments": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/7/comments"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/issues/15/comments"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7/commits"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15/commits"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://github.com/crazy-max/test-docker-action/pull/7"
|
||||
"href": "https://github.com/docker/test-docker-action/pull/15"
|
||||
},
|
||||
"issue": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/7"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/issues/15"
|
||||
},
|
||||
"review_comment": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/comments{/number}"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/comments{/number}"
|
||||
},
|
||||
"review_comments": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7/comments"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15/comments"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15"
|
||||
},
|
||||
"statuses": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/0337b3a374a0b833cf127b9111ca8c5589d93616"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/statuses/3370e228f2209994d57af4427fe64e71bb79ac96"
|
||||
}
|
||||
},
|
||||
"active_lock_reason": null,
|
||||
"additions": 0,
|
||||
"additions": 1,
|
||||
"assignee": null,
|
||||
"assignees": [],
|
||||
"author_association": "COLLABORATOR",
|
||||
@ -43,52 +57,53 @@
|
||||
"allow_merge_commit": true,
|
||||
"allow_rebase_merge": true,
|
||||
"allow_squash_merge": true,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"allow_update_branch": false,
|
||||
"archive_url": "https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"default_branch": "master",
|
||||
"delete_branch_on_merge": false,
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
"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/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"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/crazy-max/test-docker-action/forks",
|
||||
"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/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"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": false,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"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/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"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/crazy-max/test-docker-action/languages",
|
||||
"languages_url": "https://api.github.com/repos/docker/test-docker-action/languages",
|
||||
"license": {
|
||||
"key": "mit",
|
||||
"name": "MIT License",
|
||||
@ -96,88 +111,88 @@
|
||||
"spdx_id": "MIT",
|
||||
"url": "https://api.github.com/licenses/mit"
|
||||
},
|
||||
"merges_url": "https://api.github.com/repos/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"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/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 5,
|
||||
"open_issues_count": 5,
|
||||
"notifications_url": "https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 6,
|
||||
"open_issues_count": 6,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?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}",
|
||||
"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/crazy-max",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "docker",
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"received_events_url": "https://api.github.com/users/crazy-max/received_events",
|
||||
"repos_url": "https://api.github.com/users/crazy-max/repos",
|
||||
"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/crazy-max/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/crazy-max/subscriptions",
|
||||
"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/crazy-max"
|
||||
"url": "https://api.github.com/users/docker"
|
||||
},
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-10-21T21:44:34Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 714,
|
||||
"pulls_url": "https://api.github.com/repos/docker/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2022-04-19T09:04:50Z",
|
||||
"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_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"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/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-10-21T21:44:37Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"trees_url": "https://api.github.com/repos/docker/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2022-04-19T09:05:09Z",
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action",
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "ce1a91a20f9e2c064bcd76a7b95e091f831cf653",
|
||||
"sha": "266574110acf203503badf966df2ea24b5d732d7",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?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}",
|
||||
"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/crazy-max",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "docker",
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"received_events_url": "https://api.github.com/users/crazy-max/received_events",
|
||||
"repos_url": "https://api.github.com/users/crazy-max/repos",
|
||||
"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/crazy-max/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/crazy-max/subscriptions",
|
||||
"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/crazy-max"
|
||||
"url": "https://api.github.com/users/docker"
|
||||
}
|
||||
},
|
||||
"body": null,
|
||||
"changed_files": 0,
|
||||
"changed_files": 1,
|
||||
"closed_at": null,
|
||||
"comments": 0,
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/7/comments",
|
||||
"comments_url": "https://api.github.com/repos/docker/test-docker-action/issues/15/comments",
|
||||
"commits": 1,
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7/commits",
|
||||
"created_at": "2021-10-21T21:46:27Z",
|
||||
"deletions": 0,
|
||||
"diff_url": "https://github.com/crazy-max/test-docker-action/pull/7.diff",
|
||||
"commits_url": "https://api.github.com/repos/docker/test-docker-action/pulls/15/commits",
|
||||
"created_at": "2022-04-19T09:16:17Z",
|
||||
"deletions": 1,
|
||||
"diff_url": "https://github.com/docker/test-docker-action/pull/15.diff",
|
||||
"draft": false,
|
||||
"head": {
|
||||
"label": "crazy-max:test-pr",
|
||||
@ -188,6 +203,7 @@
|
||||
"allow_merge_commit": true,
|
||||
"allow_rebase_merge": true,
|
||||
"allow_squash_merge": true,
|
||||
"allow_update_branch": false,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
@ -232,7 +248,7 @@
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"language": "Dockerfile",
|
||||
"language": "JavaScript",
|
||||
"languages_url": "https://api.github.com/repos/crazy-max/test-docker-action/languages",
|
||||
"license": {
|
||||
"key": "mit",
|
||||
@ -260,7 +276,7 @@
|
||||
"id": 1951866,
|
||||
"login": "crazy-max",
|
||||
"node_id": "MDQ6VXNlcjE5NTE4NjY=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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,
|
||||
@ -271,7 +287,7 @@
|
||||
},
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-10-21T21:46:11Z",
|
||||
"pushed_at": "2022-04-19T09:16:07Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 151,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
@ -285,13 +301,13 @@
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"topics": [],
|
||||
"trees_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-07-15T07:56:00Z",
|
||||
"updated_at": "2022-04-19T09:13:10Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "0337b3a374a0b833cf127b9111ca8c5589d93616",
|
||||
"sha": "3370e228f2209994d57af4427fe64e71bb79ac96",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
"events_url": "https://api.github.com/users/crazy-max/events{/privacy}",
|
||||
@ -303,7 +319,7 @@
|
||||
"id": 1951866,
|
||||
"login": "crazy-max",
|
||||
"node_id": "MDQ6VXNlcjE5NTE4NjY=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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,
|
||||
@ -313,9 +329,9 @@
|
||||
"url": "https://api.github.com/users/crazy-max"
|
||||
}
|
||||
},
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action/pull/7",
|
||||
"id": 763682530,
|
||||
"issue_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/7",
|
||||
"html_url": "https://github.com/docker/test-docker-action/pull/15",
|
||||
"id": 912840343,
|
||||
"issue_url": "https://api.github.com/repos/docker/test-docker-action/issues/15",
|
||||
"labels": [],
|
||||
"locked": false,
|
||||
"maintainer_can_modify": true,
|
||||
@ -326,20 +342,20 @@
|
||||
"merged_at": null,
|
||||
"merged_by": null,
|
||||
"milestone": null,
|
||||
"node_id": "PR_kwDOEQjNNc4thN7i",
|
||||
"number": 7,
|
||||
"patch_url": "https://github.com/crazy-max/test-docker-action/pull/7.patch",
|
||||
"node_id": "PR_kwDOEQjNNc42aNaX",
|
||||
"number": 15,
|
||||
"patch_url": "https://github.com/docker/test-docker-action/pull/15.patch",
|
||||
"rebaseable": null,
|
||||
"requested_reviewers": [],
|
||||
"requested_teams": [],
|
||||
"review_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/comments{/number}",
|
||||
"review_comment_url": "https://api.github.com/repos/docker/test-docker-action/pulls/comments{/number}",
|
||||
"review_comments": 0,
|
||||
"review_comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7/comments",
|
||||
"review_comments_url": "https://api.github.com/repos/docker/test-docker-action/pulls/15/comments",
|
||||
"state": "open",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/0337b3a374a0b833cf127b9111ca8c5589d93616",
|
||||
"title": "Trigger notification",
|
||||
"updated_at": "2021-10-21T21:46:27Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/7",
|
||||
"statuses_url": "https://api.github.com/repos/docker/test-docker-action/statuses/3370e228f2209994d57af4427fe64e71bb79ac96",
|
||||
"title": "small change",
|
||||
"updated_at": "2022-04-19T09:16:17Z",
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/pulls/15",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
"events_url": "https://api.github.com/users/crazy-max/events{/privacy}",
|
||||
@ -351,7 +367,7 @@
|
||||
"id": 1951866,
|
||||
"login": "crazy-max",
|
||||
"node_id": "MDQ6VXNlcjE5NTE4NjY=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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,
|
||||
@ -363,51 +379,51 @@
|
||||
},
|
||||
"repository": {
|
||||
"allow_forking": true,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"archive_url": "https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
"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/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"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/crazy-max/test-docker-action/forks",
|
||||
"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/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"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": false,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"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/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"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/crazy-max/test-docker-action/languages",
|
||||
"languages_url": "https://api.github.com/repos/docker/test-docker-action/languages",
|
||||
"license": {
|
||||
"key": "mit",
|
||||
"name": "MIT License",
|
||||
@ -415,52 +431,52 @@
|
||||
"spdx_id": "MIT",
|
||||
"url": "https://api.github.com/licenses/mit"
|
||||
},
|
||||
"merges_url": "https://api.github.com/repos/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"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/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 5,
|
||||
"open_issues_count": 5,
|
||||
"notifications_url": "https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 6,
|
||||
"open_issues_count": 6,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?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}",
|
||||
"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/crazy-max",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "docker",
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"received_events_url": "https://api.github.com/users/crazy-max/received_events",
|
||||
"repos_url": "https://api.github.com/users/crazy-max/repos",
|
||||
"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/crazy-max/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/crazy-max/subscriptions",
|
||||
"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/crazy-max"
|
||||
"url": "https://api.github.com/users/docker"
|
||||
},
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-10-21T21:44:34Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 714,
|
||||
"pulls_url": "https://api.github.com/repos/docker/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2022-04-19T09:04:50Z",
|
||||
"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_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"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/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-10-21T21:44:37Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"trees_url": "https://api.github.com/repos/docker/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2022-04-19T09:05:09Z",
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action",
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
@ -476,7 +492,7 @@
|
||||
"id": 1951866,
|
||||
"login": "crazy-max",
|
||||
"node_id": "MDQ6VXNlcjE5NTE4NjY=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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,
|
||||
|
@ -1,4 +1,4 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
@ -6,20 +6,25 @@ GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=master
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_cc4da131-0660-4771-8663-0f96c0fc944f
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_2f69f48f-fb93-475f-a6a5-91dc7866f518
|
||||
GITHUB_EVENT_NAME=pull_request_target
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_pull_request_target.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=test-pr-target
|
||||
GITHUB_JOB=build
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_cc4da131-0660-4771-8663-0f96c0fc944f
|
||||
GITHUB_HEAD_REF=test-pr
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_2f69f48f-fb93-475f-a6a5-91dc7866f518
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=867725119
|
||||
GITHUB_RUN_NUMBER=12
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188688000
|
||||
GITHUB_RUN_NUMBER=10
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=f24900bfcfee76d8055c8421a164c7e57ad20e68
|
||||
GITHUB_WORKFLOW=push-ghcr
|
||||
GITHUB_SHA=266574110acf203503badf966df2ea24b5d732d7
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_2f69f48f-fb93-475f-a6a5-91dc7866f518
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,93 +1,109 @@
|
||||
{
|
||||
"action": "synchronize",
|
||||
"after": "57a8fb29acfb3c1e27c66226a8993fb4ef722e26",
|
||||
"before": "18c4c149d695bdeba42643ef8343a6b8e466970c",
|
||||
"number": 8,
|
||||
"action": "opened",
|
||||
"number": 15,
|
||||
"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"
|
||||
},
|
||||
"pull_request": {
|
||||
"_links": {
|
||||
"comments": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8/comments"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/issues/15/comments"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/commits"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15/commits"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://github.com/crazy-max/test-docker-action/pull/8"
|
||||
"href": "https://github.com/docker/test-docker-action/pull/15"
|
||||
},
|
||||
"issue": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/issues/15"
|
||||
},
|
||||
"review_comment": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/comments{/number}"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/comments{/number}"
|
||||
},
|
||||
"review_comments": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/comments"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15/comments"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/pulls/15"
|
||||
},
|
||||
"statuses": {
|
||||
"href": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/57a8fb29acfb3c1e27c66226a8993fb4ef722e26"
|
||||
"href": "https://api.github.com/repos/docker/test-docker-action/statuses/3370e228f2209994d57af4427fe64e71bb79ac96"
|
||||
}
|
||||
},
|
||||
"active_lock_reason": null,
|
||||
"additions": 1,
|
||||
"assignee": null,
|
||||
"assignees": [],
|
||||
"author_association": "OWNER",
|
||||
"author_association": "COLLABORATOR",
|
||||
"auto_merge": null,
|
||||
"base": {
|
||||
"label": "crazy-max:master",
|
||||
"label": "docker:master",
|
||||
"ref": "master",
|
||||
"repo": {
|
||||
"allow_auto_merge": false,
|
||||
"allow_forking": true,
|
||||
"allow_merge_commit": true,
|
||||
"allow_rebase_merge": true,
|
||||
"allow_squash_merge": true,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"allow_update_branch": false,
|
||||
"archive_url": "https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"default_branch": "master",
|
||||
"delete_branch_on_merge": false,
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
"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/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"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": 4,
|
||||
"forks_count": 4,
|
||||
"forks_url": "https://api.github.com/repos/crazy-max/test-docker-action/forks",
|
||||
"full_name": "crazy-max/test-docker-action",
|
||||
"git_commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"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": false,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"hooks_url": "https://api.github.com/repos/docker/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/docker/test-docker-action",
|
||||
"id": 285789493,
|
||||
"issue_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"language": "Dockerfile",
|
||||
"languages_url": "https://api.github.com/repos/crazy-max/test-docker-action/languages",
|
||||
"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",
|
||||
@ -95,94 +111,99 @@
|
||||
"spdx_id": "MIT",
|
||||
"url": "https://api.github.com/licenses/mit"
|
||||
},
|
||||
"merges_url": "https://api.github.com/repos/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"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/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 4,
|
||||
"open_issues_count": 4,
|
||||
"notifications_url": "https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 6,
|
||||
"open_issues_count": 6,
|
||||
"owner": {
|
||||
"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}",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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/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",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "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/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"
|
||||
"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": false,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-05-23T01:38:41Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 137,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
"stargazers_count": 3,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"trees_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-05-23T01:37:33Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"watchers": 3,
|
||||
"watchers_count": 3
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/docker/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2022-04-19T09:04:50Z",
|
||||
"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_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://api.github.com/repos/docker/test-docker-action",
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "2b13c4617af78dc00a6304390682f234a53f3665",
|
||||
"sha": "266574110acf203503badf966df2ea24b5d732d7",
|
||||
"user": {
|
||||
"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}",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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/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",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "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/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"
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"body": "",
|
||||
"body": null,
|
||||
"changed_files": 1,
|
||||
"closed_at": null,
|
||||
"comments": 0,
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8/comments",
|
||||
"commits": 2,
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/commits",
|
||||
"created_at": "2021-05-23T01:24:57Z",
|
||||
"comments_url": "https://api.github.com/repos/docker/test-docker-action/issues/15/comments",
|
||||
"commits": 1,
|
||||
"commits_url": "https://api.github.com/repos/docker/test-docker-action/pulls/15/commits",
|
||||
"created_at": "2022-04-19T09:16:17Z",
|
||||
"deletions": 1,
|
||||
"diff_url": "https://github.com/crazy-max/test-docker-action/pull/8.diff",
|
||||
"diff_url": "https://github.com/docker/test-docker-action/pull/15.diff",
|
||||
"draft": false,
|
||||
"head": {
|
||||
"label": "crazy-max:test-pr-target",
|
||||
"ref": "test-pr-target",
|
||||
"label": "crazy-max:test-pr",
|
||||
"ref": "test-pr",
|
||||
"repo": {
|
||||
"allow_auto_merge": false,
|
||||
"allow_forking": true,
|
||||
"allow_merge_commit": true,
|
||||
"allow_rebase_merge": true,
|
||||
"allow_squash_merge": true,
|
||||
"allow_update_branch": false,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
@ -195,7 +216,7 @@
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"created_at": "2020-08-07T09:23:00Z",
|
||||
"created_at": "2021-07-11T17:34:22Z",
|
||||
"default_branch": "master",
|
||||
"delete_branch_on_merge": false,
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
@ -203,9 +224,9 @@
|
||||
"disabled": false,
|
||||
"downloads_url": "https://api.github.com/repos/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"fork": false,
|
||||
"forks": 4,
|
||||
"forks_count": 4,
|
||||
"fork": true,
|
||||
"forks": 0,
|
||||
"forks_count": 0,
|
||||
"forks_url": "https://api.github.com/repos/crazy-max/test-docker-action/forks",
|
||||
"full_name": "crazy-max/test-docker-action",
|
||||
"git_commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
@ -215,18 +236,19 @@
|
||||
"has_downloads": true,
|
||||
"has_issues": false,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": false,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"id": 285789493,
|
||||
"id": 385013169,
|
||||
"is_template": false,
|
||||
"issue_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"language": "Dockerfile",
|
||||
"language": "JavaScript",
|
||||
"languages_url": "https://api.github.com/repos/crazy-max/test-docker-action/languages",
|
||||
"license": {
|
||||
"key": "mit",
|
||||
@ -239,10 +261,10 @@
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"mirror_url": null,
|
||||
"name": "test-docker-action",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyODU3ODk0OTM=",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkzODUwMTMxNjk=",
|
||||
"notifications_url": "https://api.github.com/repos/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 4,
|
||||
"open_issues_count": 4,
|
||||
"open_issues": 0,
|
||||
"open_issues_count": 0,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
"events_url": "https://api.github.com/users/crazy-max/events{/privacy}",
|
||||
@ -263,13 +285,13 @@
|
||||
"type": "User",
|
||||
"url": "https://api.github.com/users/crazy-max"
|
||||
},
|
||||
"private": false,
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-05-23T01:38:41Z",
|
||||
"pushed_at": "2022-04-19T09:16:07Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 137,
|
||||
"size": 151,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
"stargazers_count": 3,
|
||||
"stargazers_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
@ -277,13 +299,15 @@
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"topics": [],
|
||||
"trees_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-05-23T01:37:33Z",
|
||||
"updated_at": "2022-04-19T09:13:10Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"watchers": 3,
|
||||
"watchers_count": 3
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sha": "57a8fb29acfb3c1e27c66226a8993fb4ef722e26",
|
||||
"sha": "3370e228f2209994d57af4427fe64e71bb79ac96",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
"events_url": "https://api.github.com/users/crazy-max/events{/privacy}",
|
||||
@ -305,33 +329,33 @@
|
||||
"url": "https://api.github.com/users/crazy-max"
|
||||
}
|
||||
},
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action/pull/8",
|
||||
"id": 650710002,
|
||||
"issue_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8",
|
||||
"html_url": "https://github.com/docker/test-docker-action/pull/15",
|
||||
"id": 912840343,
|
||||
"issue_url": "https://api.github.com/repos/docker/test-docker-action/issues/15",
|
||||
"labels": [],
|
||||
"locked": false,
|
||||
"maintainer_can_modify": false,
|
||||
"merge_commit_sha": "823b99c3c3cf5421e6ff0514b13a44bf21c7a4f0",
|
||||
"maintainer_can_modify": true,
|
||||
"merge_commit_sha": null,
|
||||
"mergeable": null,
|
||||
"mergeable_state": "unknown",
|
||||
"merged": false,
|
||||
"merged_at": null,
|
||||
"merged_by": null,
|
||||
"milestone": null,
|
||||
"node_id": "MDExOlB1bGxSZXF1ZXN0NjUwNzEwMDAy",
|
||||
"number": 8,
|
||||
"patch_url": "https://github.com/crazy-max/test-docker-action/pull/8.patch",
|
||||
"node_id": "PR_kwDOEQjNNc42aNaX",
|
||||
"number": 15,
|
||||
"patch_url": "https://github.com/docker/test-docker-action/pull/15.patch",
|
||||
"rebaseable": null,
|
||||
"requested_reviewers": [],
|
||||
"requested_teams": [],
|
||||
"review_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/comments{/number}",
|
||||
"review_comment_url": "https://api.github.com/repos/docker/test-docker-action/pulls/comments{/number}",
|
||||
"review_comments": 0,
|
||||
"review_comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/comments",
|
||||
"review_comments_url": "https://api.github.com/repos/docker/test-docker-action/pulls/15/comments",
|
||||
"state": "open",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/57a8fb29acfb3c1e27c66226a8993fb4ef722e26",
|
||||
"title": "Test PR target",
|
||||
"updated_at": "2021-05-23T01:38:42Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8",
|
||||
"statuses_url": "https://api.github.com/repos/docker/test-docker-action/statuses/3370e228f2209994d57af4427fe64e71bb79ac96",
|
||||
"title": "small change",
|
||||
"updated_at": "2022-04-19T09:16:17Z",
|
||||
"url": "https://api.github.com/repos/docker/test-docker-action/pulls/15",
|
||||
"user": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
"events_url": "https://api.github.com/users/crazy-max/events{/privacy}",
|
||||
@ -354,50 +378,52 @@
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"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/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
"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/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"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": 4,
|
||||
"forks_count": 4,
|
||||
"forks_url": "https://api.github.com/repos/crazy-max/test-docker-action/forks",
|
||||
"full_name": "crazy-max/test-docker-action",
|
||||
"git_commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"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": false,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"hooks_url": "https://api.github.com/repos/docker/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/docker/test-docker-action",
|
||||
"id": 285789493,
|
||||
"issue_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"language": "Dockerfile",
|
||||
"languages_url": "https://api.github.com/repos/crazy-max/test-docker-action/languages",
|
||||
"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",
|
||||
@ -405,53 +431,55 @@
|
||||
"spdx_id": "MIT",
|
||||
"url": "https://api.github.com/licenses/mit"
|
||||
},
|
||||
"merges_url": "https://api.github.com/repos/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"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/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 4,
|
||||
"open_issues_count": 4,
|
||||
"notifications_url": "https://api.github.com/repos/docker/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 6,
|
||||
"open_issues_count": 6,
|
||||
"owner": {
|
||||
"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}",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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/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",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "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/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"
|
||||
"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": false,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2021-05-23T01:38:41Z",
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 137,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
"stargazers_count": 3,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"trees_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-05-23T01:37:33Z",
|
||||
"url": "https://api.github.com/repos/crazy-max/test-docker-action",
|
||||
"watchers": 3,
|
||||
"watchers_count": 3
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/docker/test-docker-action/pulls{/number}",
|
||||
"pushed_at": "2022-04-19T09:04:50Z",
|
||||
"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_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://api.github.com/repos/docker/test-docker-action",
|
||||
"visibility": "private",
|
||||
"watchers": 0,
|
||||
"watchers_count": 0
|
||||
},
|
||||
"sender": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/1951866?v=4",
|
||||
|
@ -1,23 +0,0 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_EVENT_NAME=push
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_push.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_REF=refs/heads/dev
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325957516
|
||||
GITHUB_RUN_NUMBER=1
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
@ -1,181 +0,0 @@
|
||||
{
|
||||
"after": "ce1a91a20f9e2c064bcd76a7b95e091f831cf653",
|
||||
"base_ref": null,
|
||||
"before": "b0d66d13d5e8c795e0fc4b6c732b6b521807eca7",
|
||||
"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": "ce1a91a20f9e2c064bcd76a7b95e091f831cf653",
|
||||
"message": "Fix workflow",
|
||||
"timestamp": "2021-10-21T23:44:33+02:00",
|
||||
"tree_id": "8e46bf0c7fd95050deb02b11f0bc8c475c7428f3",
|
||||
"url": "https://github.com/crazy-max/test-docker-action/commit/ce1a91a20f9e2c064bcd76a7b95e091f831cf653"
|
||||
}
|
||||
],
|
||||
"compare": "https://github.com/crazy-max/test-docker-action/compare/b0d66d13d5e8...ce1a91a20f9e",
|
||||
"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": "ce1a91a20f9e2c064bcd76a7b95e091f831cf653",
|
||||
"message": "Fix workflow",
|
||||
"timestamp": "2021-10-21T23:44:33+02:00",
|
||||
"tree_id": "8e46bf0c7fd95050deb02b11f0bc8c475c7428f3",
|
||||
"url": "https://github.com/crazy-max/test-docker-action/commit/ce1a91a20f9e2c064bcd76a7b95e091f831cf653"
|
||||
},
|
||||
"pusher": {
|
||||
"email": "crazy-max@users.noreply.github.com",
|
||||
"name": "crazy-max"
|
||||
},
|
||||
"ref": "refs/heads/master",
|
||||
"repository": {
|
||||
"allow_forking": true,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"created_at": 1596792180,
|
||||
"default_branch": "master",
|
||||
"deployments_url": "https://api.github.com/repos/crazy-max/test-docker-action/deployments",
|
||||
"description": "Test \"Docker\" Actions",
|
||||
"disabled": false,
|
||||
"downloads_url": "https://api.github.com/repos/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"fork": false,
|
||||
"forks": 1,
|
||||
"forks_count": 1,
|
||||
"forks_url": "https://api.github.com/repos/crazy-max/test-docker-action/forks",
|
||||
"full_name": "crazy-max/test-docker-action",
|
||||
"git_commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"has_downloads": true,
|
||||
"has_issues": false,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"id": 285789493,
|
||||
"is_template": false,
|
||||
"issue_comment_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"language": "JavaScript",
|
||||
"languages_url": "https://api.github.com/repos/crazy-max/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/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"mirror_url": null,
|
||||
"name": "test-docker-action",
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyODU3ODk0OTM=",
|
||||
"notifications_url": "https://api.github.com/repos/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 4,
|
||||
"open_issues_count": 4,
|
||||
"organization": "docker",
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"email": "info@docker.com",
|
||||
"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": 5429470,
|
||||
"login": "docker",
|
||||
"name": "docker",
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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": "Organization",
|
||||
"url": "https://api.github.com/users/crazy-max"
|
||||
},
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": 1634852674,
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 714,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
"stargazers": 0,
|
||||
"stargazers_count": 0,
|
||||
"stargazers_url": "https://api.github.com/repos/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"topics": [],
|
||||
"trees_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-10-21T21:43:51Z",
|
||||
"url": "https://github.com/crazy-max/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/users",
|
||||
"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"
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325957516
|
||||
GITHUB_RUN_NUMBER=1
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
30
__tests__/fixtures/event_push_dev.env
Normal file
30
__tests__/fixtures/event_push_dev.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_dce158a5-37b3-4081-8414-32238d5cfa7b
|
||||
GITHUB_EVENT_NAME=push
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_push_dev.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_dce158a5-37b3-4081-8414-32238d5cfa7b
|
||||
GITHUB_REF=refs/heads/dev
|
||||
GITHUB_REF_NAME=dev
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188748038
|
||||
GITHUB_RUN_NUMBER=15
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_dce158a5-37b3-4081-8414-32238d5cfa7b
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
195
__tests__/fixtures/event_push_dev.json
Normal file
195
__tests__/fixtures/event_push_dev.json
Normal file
@ -0,0 +1,195 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_5d7d8f7f-4b47-4f4c-b32a-e7fa634790c9
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_push_invalidchars.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_89a016e8-e5b7-4039-a67e-c8da08f87a0c
|
||||
GITHUB_REF="refs/heads/my/feature#1245"
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_5d7d8f7f-4b47-4f4c-b32a-e7fa634790c9
|
||||
GITHUB_REF=refs/heads/my/feature#1245
|
||||
GITHUB_REF_NAME=my/feature#1245
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325957516
|
||||
GITHUB_RUN_NUMBER=1
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188792787
|
||||
GITHUB_RUN_NUMBER=19
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=983315b5e8d46e46fc4c49869e85e7ee5fb289ba
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_5d7d8f7f-4b47-4f4c-b32a-e7fa634790c9
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
195
__tests__/fixtures/event_push_invalidchars.json
Normal file
195
__tests__/fixtures/event_push_invalidchars.json
Normal file
@ -0,0 +1,195 @@
|
||||
{
|
||||
"after": "983315b5e8d46e46fc4c49869e85e7ee5fb289ba",
|
||||
"base_ref": null,
|
||||
"before": "4af2cc040e1cee6ee91e2491f34e5787121eb902",
|
||||
"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": "983315b5e8d46e46fc4c49869e85e7ee5fb289ba",
|
||||
"message": "feature 1245",
|
||||
"timestamp": "2022-04-19T11:36:08+02:00",
|
||||
"tree_id": "e9f7b0bf689a49a4792d518088710dadb52d7e9a",
|
||||
"url": "https://github.com/docker/test-docker-action/commit/983315b5e8d46e46fc4c49869e85e7ee5fb289ba"
|
||||
}
|
||||
],
|
||||
"compare": "https://github.com/docker/test-docker-action/compare/4af2cc040e1c...983315b5e8d4",
|
||||
"created": false,
|
||||
"deleted": false,
|
||||
"forced": true,
|
||||
"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": "983315b5e8d46e46fc4c49869e85e7ee5fb289ba",
|
||||
"message": "feature 1245",
|
||||
"timestamp": "2022-04-19T11:36:08+02:00",
|
||||
"tree_id": "e9f7b0bf689a49a4792d518088710dadb52d7e9a",
|
||||
"url": "https://github.com/docker/test-docker-action/commit/983315b5e8d46e46fc4c49869e85e7ee5fb289ba"
|
||||
},
|
||||
"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/my/feature#1245",
|
||||
"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": 1650360972,
|
||||
"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"
|
||||
}
|
||||
}
|
30
__tests__/fixtures/event_push_master.env
Normal file
30
__tests__/fixtures/event_push_master.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_f5600b76-1b08-404a-8e90-7f2cd620928b
|
||||
GITHUB_EVENT_NAME=push
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_push_master.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_f5600b76-1b08-404a-8e90-7f2cd620928b
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188627423
|
||||
GITHUB_RUN_NUMBER=6
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=266574110acf203503badf966df2ea24b5d732d7
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_f5600b76-1b08-404a-8e90-7f2cd620928b
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
195
__tests__/fixtures/event_push_master.json
Normal file
195
__tests__/fixtures/event_push_master.json
Normal file
@ -0,0 +1,195 @@
|
||||
{
|
||||
"after": "266574110acf203503badf966df2ea24b5d732d7",
|
||||
"base_ref": null,
|
||||
"before": "ef1a8e2e6a91ffa6837f19f7743405b709363225",
|
||||
"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": "266574110acf203503badf966df2ea24b5d732d7",
|
||||
"message": "more events",
|
||||
"timestamp": "2022-04-19T11:04:39+02:00",
|
||||
"tree_id": "03b667a843ece33c75ef5eb23ca5bc8fc3b876e4",
|
||||
"url": "https://github.com/docker/test-docker-action/commit/266574110acf203503badf966df2ea24b5d732d7"
|
||||
}
|
||||
],
|
||||
"compare": "https://github.com/docker/test-docker-action/compare/ef1a8e2e6a91...266574110acf",
|
||||
"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": "266574110acf203503badf966df2ea24b5d732d7",
|
||||
"message": "more events",
|
||||
"timestamp": "2022-04-19T11:04:39+02:00",
|
||||
"tree_id": "03b667a843ece33c75ef5eb23ca5bc8fc3b876e4",
|
||||
"url": "https://github.com/docker/test-docker-action/commit/266574110acf203503badf966df2ea24b5d732d7"
|
||||
},
|
||||
"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/master",
|
||||
"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": false,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"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": 4,
|
||||
"open_issues_count": 4,
|
||||
"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": 1650359090,
|
||||
"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": "2021-12-21T21:49:29Z",
|
||||
"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"
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7c207886-8ce7-4ad2-9b7f-f59dae4e5cf3
|
||||
GITHUB_EVENT_NAME=release
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7c207886-8ce7-4ad2-9b7f-f59dae4e5cf3
|
||||
GITHUB_REF=refs/tags/v1.1.1
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325970352
|
||||
GITHUB_RUN_NUMBER=5
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
30
__tests__/fixtures/event_release_created.env
Normal file
30
__tests__/fixtures/event_release_created.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_82c844c7-54b3-4b5d-a1e1-4f9f2e936d4f
|
||||
GITHUB_EVENT_NAME=release
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_release_created.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_82c844c7-54b3-4b5d-a1e1-4f9f2e936d4f
|
||||
GITHUB_REF=refs/tags/v1.1.1
|
||||
GITHUB_REF_NAME=v1.1.1
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188867972
|
||||
GITHUB_RUN_NUMBER=26
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_82c844c7-54b3-4b5d-a1e1-4f9f2e936d4f
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
80
__tests__/fixtures/event_release_created.json
Normal file
80
__tests__/fixtures/event_release_created.json
Normal file
@ -0,0 +1,80 @@
|
||||
{
|
||||
"action": "created",
|
||||
"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"
|
||||
},
|
||||
"release": {
|
||||
"assets": [],
|
||||
"assets_url": "https://api.github.com/repos/docker/test-docker-action/releases/64718198/assets",
|
||||
"author": {
|
||||
"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"
|
||||
},
|
||||
"body": "foo",
|
||||
"created_at": "2022-04-19T09:39:35Z",
|
||||
"draft": false,
|
||||
"html_url": "https://github.com/docker/test-docker-action/releases/tag/v1.1.1",
|
||||
"id": 64718198,
|
||||
"name": "v1.1.1",
|
||||
"node_id": "RE_kwDOEQjNNc4D24V2",
|
||||
"prerelease": true,
|
||||
"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://api.github.com/repos/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"
|
||||
}
|
||||
}
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_5705dc72-e111-46f1-9421-a77a2daec643
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c8594ff3-bed7-4fb7-b495-c63872db99a2
|
||||
GITHUB_EVENT_NAME=schedule
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_schedule.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_5705dc72-e111-46f1-9421-a77a2daec643
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_c8594ff3-bed7-4fb7-b495-c63872db99a2
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325965155
|
||||
GITHUB_RUN_NUMBER=3
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188841209
|
||||
GITHUB_RUN_NUMBER=24
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_c8594ff3-bed7-4fb7-b495-c63872db99a2
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
3
__tests__/fixtures/event_schedule.json
Normal file
3
__tests__/fixtures/event_schedule.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"schedule": "*/10 * * * *"
|
||||
}
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_1.0dev4.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/1.0dev4
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=1.0dev4
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_1.1beta2.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/1.1beta2
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=1.1beta2
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_1.2.3rc2.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/1.2.3rc2
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=1.2.3rc2
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_1.2.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/1.2
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=1.2
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_1.2post1.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/1.2post1
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=1.2post1
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_20200110-RC2.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/20200110-RC2
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=20200110-RC2
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_p1-v1.0.0.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/p1/v1.0.0
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=p1/v1.0.0
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_release1.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/release1
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=release1
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_sometag.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/sometag
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=sometag
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_v1.1.1.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/v1.1.1
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=v1.1.1
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"after": "8415a46e9494b78eca43a2dd8dca716b86b9df85",
|
||||
"after": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||
"base_ref": "refs/heads/master",
|
||||
"before": "0000000000000000000000000000000000000000",
|
||||
"commits": [],
|
||||
"compare": "https://github.com/crazy-max/test-docker-action/compare/v1.1.1",
|
||||
"compare": "https://github.com/docker/test-docker-action/compare/v1.1.1",
|
||||
"created": true,
|
||||
"deleted": false,
|
||||
"forced": false,
|
||||
@ -14,69 +14,83 @@
|
||||
"username": "crazy-max"
|
||||
},
|
||||
"committer": {
|
||||
"email": "noreply@github.com",
|
||||
"name": "GitHub",
|
||||
"username": "web-flow"
|
||||
"email": "crazy-max@users.noreply.github.com",
|
||||
"name": "CrazyMax",
|
||||
"username": "crazy-max"
|
||||
},
|
||||
"distinct": true,
|
||||
"id": "8415a46e9494b78eca43a2dd8dca716b86b9df85",
|
||||
"message": "Trigger notification (#11)\n\nCo-authored-by: CrazyMax <crazy-max@users.noreply.github.com>",
|
||||
"timestamp": "2021-10-21T23:47:22+02:00",
|
||||
"tree_id": "8e46bf0c7fd95050deb02b11f0bc8c475c7428f3",
|
||||
"url": "https://github.com/crazy-max/test-docker-action/commit/8415a46e9494b78eca43a2dd8dca716b86b9df85"
|
||||
"id": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||
"message": "scheduled",
|
||||
"timestamp": "2022-04-19T11:39:35+02:00",
|
||||
"tree_id": "1d3608c3f204a4d754a1db925264929afd54daad",
|
||||
"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": "crazy-max@users.noreply.github.com",
|
||||
"email": "github@crazymax.dev",
|
||||
"name": "crazy-max"
|
||||
},
|
||||
"ref": "refs/tags/v1.1.1",
|
||||
"repository": {
|
||||
"allow_forking": true,
|
||||
"archive_url": "https://api.github.com/repos/crazy-max/test-docker-action/{archive_format}{/ref}",
|
||||
"archive_url": "https://api.github.com/repos/docker/test-docker-action/{archive_format}{/ref}",
|
||||
"archived": false,
|
||||
"assignees_url": "https://api.github.com/repos/crazy-max/test-docker-action/assignees{/user}",
|
||||
"blobs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/blobs{/sha}",
|
||||
"branches_url": "https://api.github.com/repos/crazy-max/test-docker-action/branches{/branch}",
|
||||
"clone_url": "https://github.com/crazy-max/test-docker-action.git",
|
||||
"collaborators_url": "https://api.github.com/repos/crazy-max/test-docker-action/collaborators{/collaborator}",
|
||||
"comments_url": "https://api.github.com/repos/crazy-max/test-docker-action/comments{/number}",
|
||||
"commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/commits{/sha}",
|
||||
"compare_url": "https://api.github.com/repos/crazy-max/test-docker-action/compare/{base}...{head}",
|
||||
"contents_url": "https://api.github.com/repos/crazy-max/test-docker-action/contents/{+path}",
|
||||
"contributors_url": "https://api.github.com/repos/crazy-max/test-docker-action/contributors",
|
||||
"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/crazy-max/test-docker-action/deployments",
|
||||
"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/crazy-max/test-docker-action/downloads",
|
||||
"events_url": "https://api.github.com/repos/crazy-max/test-docker-action/events",
|
||||
"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/crazy-max/test-docker-action/forks",
|
||||
"full_name": "crazy-max/test-docker-action",
|
||||
"git_commits_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/commits{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/refs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/git/tags{/sha}",
|
||||
"git_url": "git://github.com/crazy-max/test-docker-action.git",
|
||||
"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": false,
|
||||
"has_issues": true,
|
||||
"has_pages": false,
|
||||
"has_projects": false,
|
||||
"has_wiki": false,
|
||||
"has_projects": true,
|
||||
"has_wiki": true,
|
||||
"homepage": "",
|
||||
"hooks_url": "https://api.github.com/repos/crazy-max/test-docker-action/hooks",
|
||||
"html_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"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/crazy-max/test-docker-action/issues/comments{/number}",
|
||||
"issue_events_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues/events{/number}",
|
||||
"issues_url": "https://api.github.com/repos/crazy-max/test-docker-action/issues{/number}",
|
||||
"keys_url": "https://api.github.com/repos/crazy-max/test-docker-action/keys{/key_id}",
|
||||
"labels_url": "https://api.github.com/repos/crazy-max/test-docker-action/labels{/name}",
|
||||
"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/crazy-max/test-docker-action/languages",
|
||||
"languages_url": "https://api.github.com/repos/docker/test-docker-action/languages",
|
||||
"license": {
|
||||
"key": "mit",
|
||||
"name": "MIT License",
|
||||
@ -85,56 +99,56 @@
|
||||
"url": "https://api.github.com/licenses/mit"
|
||||
},
|
||||
"master_branch": "master",
|
||||
"merges_url": "https://api.github.com/repos/crazy-max/test-docker-action/merges",
|
||||
"milestones_url": "https://api.github.com/repos/crazy-max/test-docker-action/milestones{/number}",
|
||||
"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/crazy-max/test-docker-action/notifications{?since,all,participating}",
|
||||
"open_issues": 4,
|
||||
"open_issues_count": 4,
|
||||
"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/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}",
|
||||
"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/crazy-max",
|
||||
"html_url": "https://github.com/docker",
|
||||
"id": 5429470,
|
||||
"login": "docker",
|
||||
"name": "docker",
|
||||
"node_id": "MDEyOk9yZ2FuaXphdGlvbjU0Mjk0NzA=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"received_events_url": "https://api.github.com/users/crazy-max/received_events",
|
||||
"repos_url": "https://api.github.com/users/crazy-max/repos",
|
||||
"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/crazy-max/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/crazy-max/subscriptions",
|
||||
"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/crazy-max"
|
||||
"url": "https://api.github.com/users/docker"
|
||||
},
|
||||
"private": true,
|
||||
"pulls_url": "https://api.github.com/repos/crazy-max/test-docker-action/pulls{/number}",
|
||||
"pushed_at": 1634852872,
|
||||
"releases_url": "https://api.github.com/repos/crazy-max/test-docker-action/releases{/id}",
|
||||
"size": 714,
|
||||
"ssh_url": "git@github.com:crazy-max/test-docker-action.git",
|
||||
"pulls_url": "https://api.github.com/repos/docker/test-docker-action/pulls{/number}",
|
||||
"pushed_at": 1650361263,
|
||||
"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/crazy-max/test-docker-action/stargazers",
|
||||
"statuses_url": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/{sha}",
|
||||
"subscribers_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/crazy-max/test-docker-action/subscription",
|
||||
"svn_url": "https://github.com/crazy-max/test-docker-action",
|
||||
"tags_url": "https://api.github.com/repos/crazy-max/test-docker-action/tags",
|
||||
"teams_url": "https://api.github.com/repos/crazy-max/test-docker-action/teams",
|
||||
"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/crazy-max/test-docker-action/git/trees{/sha}",
|
||||
"updated_at": "2021-10-21T21:47:25Z",
|
||||
"url": "https://github.com/crazy-max/test-docker-action",
|
||||
"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
|
||||
@ -150,7 +164,7 @@
|
||||
"id": 1951866,
|
||||
"login": "crazy-max",
|
||||
"node_id": "MDQ6VXNlcjE5NTE4NjY=",
|
||||
"organizations_url": "https://api.github.com/users/crazy-max/users",
|
||||
"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,
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_v1.2.3rc2.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/v1.2.3rc2
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=v1.2.3rc2
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_EVENT_NAME=push
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
#GITHUB_EVENT_PATH=./__tests__/fixtures/event_tag_v2.0.8-beta.67.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_6ee180c2-b331-434a-a867-89534cbefd83
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_REF=refs/tags/v2.0.8-beta.67
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=v2.0.8-beta.67
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=tag
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325968230
|
||||
GITHUB_RUN_NUMBER=4
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188815933
|
||||
GITHUB_RUN_NUMBER=21
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_7703d3cb-84db-438f-9f97-46e159388a55
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
@ -1,23 +1,30 @@
|
||||
GITHUB_ACTION=crazy-maxghaction-dump-context
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_4c49cda0-764d-4055-9bd9-7caf67fcb10c
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_397d8f76-d5a2-478b-94ec-cadbffd1c08e
|
||||
GITHUB_EVENT_NAME=workflow_dispatch
|
||||
#GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_workflow_dispatch.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=event
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_4c49cda0-764d-4055-9bd9-7caf67fcb10c
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_397d8f76-d5a2-478b-94ec-cadbffd1c08e
|
||||
GITHUB_REF=refs/heads/master
|
||||
GITHUB_REPOSITORY=crazy-max/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=crazy-max
|
||||
GITHUB_REF_NAME=master
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ID=325962325
|
||||
GITHUB_RUN_NUMBER=2
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188839914
|
||||
GITHUB_RUN_NUMBER=23
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=90dd6032fac8bda1b6c4436a2e65de27961ed071
|
||||
GITHUB_WORKFLOW=event
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_397d8f76-d5a2-478b-94ec-cadbffd1c08e
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
||||
|
145
__tests__/fixtures/event_workflow_dispatch.json
Normal file
145
__tests__/fixtures/event_workflow_dispatch.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"inputs": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"ref": "refs/heads/master",
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:41:03Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
},
|
||||
"workflow": ".github/workflows/metadata.yml"
|
||||
}
|
30
__tests__/fixtures/event_workflow_dispatch_dev.env
Normal file
30
__tests__/fixtures/event_workflow_dispatch_dev.env
Normal file
@ -0,0 +1,30 @@
|
||||
GITHUB_ACTION=__crazy-max_ghaction-dump-context
|
||||
GITHUB_ACTIONS=true
|
||||
GITHUB_ACTION_PATH=/home/runner/work/_actions/crazy-max/ghaction-dump-context/v1
|
||||
GITHUB_ACTION_REF=
|
||||
GITHUB_ACTION_REPOSITORY=
|
||||
GITHUB_ACTOR=crazy-max
|
||||
GITHUB_API_URL=https://api.github.com
|
||||
GITHUB_BASE_REF=
|
||||
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_81f7da89-3d0b-493a-af1f-c67e5f779727
|
||||
GITHUB_EVENT_NAME=workflow_dispatch
|
||||
GITHUB_EVENT_PATH=./__tests__/fixtures/event_workflow_dispatch_dev.json
|
||||
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
|
||||
GITHUB_HEAD_REF=
|
||||
GITHUB_JOB=test
|
||||
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_81f7da89-3d0b-493a-af1f-c67e5f779727
|
||||
GITHUB_REF=refs/heads/dev
|
||||
GITHUB_REF_NAME=dev
|
||||
GITHUB_REF_PROTECTED=false
|
||||
GITHUB_REF_TYPE=branch
|
||||
GITHUB_REPOSITORY=docker/test-docker-action
|
||||
GITHUB_REPOSITORY_OWNER=docker
|
||||
GITHUB_RETENTION_DAYS=90
|
||||
GITHUB_RUN_ATTEMPT=1
|
||||
GITHUB_RUN_ID=2188848679
|
||||
GITHUB_RUN_NUMBER=25
|
||||
GITHUB_SERVER_URL=https://github.com
|
||||
GITHUB_SHA=860c1904a1ce19322e91ac35af1ab07466440c37
|
||||
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_81f7da89-3d0b-493a-af1f-c67e5f779727
|
||||
GITHUB_WORKFLOW=metadata
|
||||
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action
|
145
__tests__/fixtures/event_workflow_dispatch_dev.json
Normal file
145
__tests__/fixtures/event_workflow_dispatch_dev.json
Normal file
@ -0,0 +1,145 @@
|
||||
{
|
||||
"inputs": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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": "2020-08-07T09:23:00Z",
|
||||
"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"
|
||||
},
|
||||
"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,
|
||||
"owner": {
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/5429470?v=4",
|
||||
"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",
|
||||
"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": "2022-04-19T09:41:03Z",
|
||||
"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_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://api.github.com/repos/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"
|
||||
},
|
||||
"workflow": ".github/workflows/metadata.yml"
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
|
||||
import {Flavor, Transform} from '../src/flavor';
|
||||
|
||||
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();
|
||||
});
|
||||
});
|
102
__tests__/image.test.ts
Normal file
102
__tests__/image.test.ts
Normal file
@ -0,0 +1,102 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
|
||||
import {Transform, Image} from '../src/image';
|
||||
|
||||
describe('transform', () => {
|
||||
// prettier-ignore
|
||||
test.each([
|
||||
[
|
||||
[
|
||||
`name/foo`
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `name/foo`,
|
||||
enable: true,
|
||||
}
|
||||
] as Image[],
|
||||
false
|
||||
],
|
||||
[
|
||||
[
|
||||
`name/foo,name/bar`
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `name/foo`,
|
||||
enable: true,
|
||||
},
|
||||
{
|
||||
name: `name/bar`,
|
||||
enable: true,
|
||||
}
|
||||
] as Image[],
|
||||
false
|
||||
],
|
||||
[
|
||||
[
|
||||
`name/foo`,
|
||||
`name/bar`
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `name/foo`,
|
||||
enable: true,
|
||||
},
|
||||
{
|
||||
name: `name/bar`,
|
||||
enable: true,
|
||||
}
|
||||
] as Image[],
|
||||
false
|
||||
],
|
||||
[
|
||||
[
|
||||
`name=name/bar`,
|
||||
`name/foo,enable=false`,
|
||||
`name=ghcr.io/UserName/Foo,enable=true`
|
||||
],
|
||||
[
|
||||
{
|
||||
name: `name/bar`,
|
||||
enable: true,
|
||||
},
|
||||
{
|
||||
name: `name/foo`,
|
||||
enable: false,
|
||||
},
|
||||
{
|
||||
name: `ghcr.io/UserName/Foo`,
|
||||
enable: true,
|
||||
},
|
||||
] as Image[],
|
||||
false
|
||||
],
|
||||
[
|
||||
[`value=name/foo`], undefined, true
|
||||
],
|
||||
[
|
||||
[`name/foo,enable=bar`], undefined, true
|
||||
],
|
||||
[
|
||||
[`name/foo,bar=baz`], undefined, true
|
||||
],
|
||||
[
|
||||
[`name=,enable=true`], undefined, true
|
||||
],
|
||||
[
|
||||
[`name/foo,name=name/bar,enable=true`], undefined, true
|
||||
]
|
||||
])('given %p', async (l: string[], expected: Image[] | undefined, invalid: boolean) => {
|
||||
try {
|
||||
const images = Transform(l);
|
||||
expect(images).toEqual(expected);
|
||||
} catch (err) {
|
||||
if (!invalid) {
|
||||
console.error(err);
|
||||
}
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(true).toBe(invalid);
|
||||
}
|
||||
});
|
||||
});
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,5 @@
|
||||
import {describe, expect, test} from '@jest/globals';
|
||||
|
||||
import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag';
|
||||
|
||||
describe('transform', () => {
|
||||
@ -126,6 +127,18 @@ describe('parse', () => {
|
||||
} as Tag,
|
||||
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}}`,
|
||||
{
|
||||
@ -417,11 +430,6 @@ describe('parse', () => {
|
||||
{} as Tag,
|
||||
true
|
||||
],
|
||||
[
|
||||
`type=sha,enable=foo`,
|
||||
{} as Tag,
|
||||
true
|
||||
],
|
||||
[
|
||||
`type=sha,format=foo`,
|
||||
{} as Tag,
|
||||
|
26
action.yml
26
action.yml
@ -7,9 +7,13 @@ branding:
|
||||
color: 'blue'
|
||||
|
||||
inputs:
|
||||
context:
|
||||
description: 'Where to get context data. Allowed options are "workflow" (default), "git".'
|
||||
default: "workflow"
|
||||
required: true
|
||||
images:
|
||||
description: 'List of Docker images to use as base name for tags'
|
||||
required: true
|
||||
required: false
|
||||
tags:
|
||||
description: 'List of tags as key-value pair attributes'
|
||||
required: false
|
||||
@ -19,12 +23,18 @@ inputs:
|
||||
labels:
|
||||
description: 'List of custom labels'
|
||||
required: false
|
||||
annotations:
|
||||
description: 'List of custom annotations'
|
||||
required: false
|
||||
sep-tags:
|
||||
description: 'Separator to use for tags output (default \n)'
|
||||
required: false
|
||||
sep-labels:
|
||||
description: 'Separator to use for labels output (default \n)'
|
||||
required: false
|
||||
sep-annotations:
|
||||
description: 'Separator to use for annotations output (default \n)'
|
||||
required: false
|
||||
bake-target:
|
||||
description: 'Bake target name (default docker-metadata-action)'
|
||||
required: false
|
||||
@ -40,11 +50,19 @@ outputs:
|
||||
description: 'Generated Docker tags'
|
||||
labels:
|
||||
description: 'Generated Docker labels'
|
||||
bake-file:
|
||||
description: 'Bake definiton file'
|
||||
annotations:
|
||||
description: 'Generated annotations'
|
||||
json:
|
||||
description: 'JSON output of tags and labels'
|
||||
bake-file-tags:
|
||||
description: 'Bake definition file with tags'
|
||||
bake-file-labels:
|
||||
description: 'Bake definition file with labels'
|
||||
bake-file-annotations:
|
||||
description: 'Bake definition file with annotations'
|
||||
bake-file:
|
||||
description: 'Bake definition file with tags and labels'
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
@ -1,13 +1,20 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=12
|
||||
ARG NODE_VERSION=20
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git
|
||||
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
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||
|
||||
@ -16,18 +23,19 @@ COPY --from=deps /vendor /
|
||||
|
||||
FROM deps AS vendor-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /vendor/* .
|
||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||
git status --porcelain -- yarn.lock
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS build
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||
|
||||
@ -36,36 +44,37 @@ COPY --from=build /out /
|
||||
|
||||
FROM build AS build-validate
|
||||
RUN --mount=type=bind,target=.,rw <<EOT
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
git status --porcelain -- dist
|
||||
exit 1
|
||||
fi
|
||||
set -e
|
||||
git add -A
|
||||
cp -rf /out/* .
|
||||
if [ -n "$(git status --porcelain -- dist)" ]; then
|
||||
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
|
||||
git status --porcelain -- dist
|
||||
exit 1
|
||||
fi
|
||||
EOT
|
||||
|
||||
FROM deps AS format
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run format \
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||
|
||||
FROM scratch AS format-update
|
||||
COPY --from=format /out /
|
||||
|
||||
FROM deps AS lint
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run lint
|
||||
|
||||
FROM deps AS test
|
||||
ENV RUNNER_TEMP=/tmp/github_runner
|
||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
||||
RUN --mount=type=bind,target=.,rw \
|
||||
--mount=type=cache,target=/src/.yarn/cache \
|
||||
--mount=type=cache,target=/src/node_modules \
|
||||
yarn run test --coverageDirectory=/tmp/coverage
|
||||
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||
|
||||
FROM scratch AS test-coverage
|
||||
COPY --from=test /tmp/coverage /
|
||||
|
127
dist/index.js
generated
vendored
127
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
3226
dist/licenses.txt
generated
vendored
3226
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,9 +1,15 @@
|
||||
target "_common" {
|
||||
args = {
|
||||
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||
}
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["build"]
|
||||
}
|
||||
|
||||
group "pre-checkin" {
|
||||
targets = ["vendor-update", "format", "build"]
|
||||
targets = ["vendor", "format", "build"]
|
||||
}
|
||||
|
||||
group "validate" {
|
||||
@ -11,42 +17,49 @@ group "validate" {
|
||||
}
|
||||
|
||||
target "build" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "build-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "build-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "format" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "format-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "lint" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "lint"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "vendor-update" {
|
||||
target "vendor" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-update"
|
||||
output = ["."]
|
||||
}
|
||||
|
||||
target "vendor-validate" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "vendor-validate"
|
||||
output = ["type=cacheonly"]
|
||||
}
|
||||
|
||||
target "test" {
|
||||
inherits = ["_common"]
|
||||
dockerfile = "dev.Dockerfile"
|
||||
target = "test-coverage"
|
||||
output = ["./coverage"]
|
||||
|
@ -1,10 +1,31 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-'));
|
||||
|
||||
process.env = Object.assign({}, process.env, {
|
||||
TEMP: tmpDir,
|
||||
GITHUB_REPOSITORY: 'docker/metadata-action',
|
||||
RUNNER_TEMP: path.join(tmpDir, 'runner-temp'),
|
||||
RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache')
|
||||
}) as {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
testEnvironment: 'node',
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
setupFiles: ['dotenv/config'],
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
|
||||
},
|
||||
collectCoverageFrom: ['src/**/{!(main.ts),}.ts'],
|
||||
coveragePathIgnorePatterns: ['lib/', 'node_modules/', '__mocks__/', '__tests__/'],
|
||||
verbose: true
|
||||
};
|
||||
|
68
package.json
68
package.json
@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "docker-metadata-action",
|
||||
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
||||
"main": "lib/main.js",
|
||||
"main": "src/main.ts",
|
||||
"scripts": {
|
||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
||||
"test": "jest --coverage",
|
||||
"all": "yarn run build && yarn run format && yarn test"
|
||||
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||
"lint": "yarn run prettier && yarn run eslint",
|
||||
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||
"eslint": "eslint --max-warnings=0 .",
|
||||
"eslint:fix": "eslint --fix .",
|
||||
"prettier": "prettier --check \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -20,39 +23,36 @@
|
||||
"tag",
|
||||
"label"
|
||||
],
|
||||
"author": "Docker",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "CrazyMax",
|
||||
"url": "https://crazymax.dev"
|
||||
}
|
||||
],
|
||||
"author": "Docker Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"packageManager": "yarn@3.6.3",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.6.0",
|
||||
"@actions/github": "^5.0.1",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/github": "^6.0.0",
|
||||
"@docker/actions-toolkit": "^0.56.0",
|
||||
"@renovate/pep440": "^1.0.0",
|
||||
"csv-parse": "^4.16.3",
|
||||
"handlebars": "^4.7.7",
|
||||
"moment": "^2.29.2",
|
||||
"semver": "^7.3.5"
|
||||
"csv-parse": "^5.6.0",
|
||||
"handlebars": "^4.7.8",
|
||||
"moment": "^2.30.1",
|
||||
"moment-timezone": "^0.5.47",
|
||||
"semver": "^7.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/csv-parse": "^1.2.2",
|
||||
"@types/node": "^16.11.26",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
||||
"@typescript-eslint/parser": "^5.14.0",
|
||||
"@vercel/ncc": "^0.33.3",
|
||||
"dotenv": "^16.0.0",
|
||||
"eslint": "^8.11.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-jest": "^26.1.1",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^27.2.5",
|
||||
"prettier": "^2.3.1",
|
||||
"ts-jest": "^27.1.2",
|
||||
"ts-node": "^10.7.0",
|
||||
"typescript": "^4.4.4"
|
||||
"@types/node": "^20.12.12",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
||||
"@typescript-eslint/parser": "^7.9.0",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-jest": "^28.5.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.2.5",
|
||||
"ts-jest": "^29.1.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
150
src/context.ts
150
src/context.ts
@ -1,78 +1,136 @@
|
||||
import csvparse from 'csv-parse/lib/sync';
|
||||
import * as core from '@actions/core';
|
||||
import {issueCommand} from '@actions/core/lib/command';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {Context as GithubContext} from '@actions/github/lib/context';
|
||||
import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import {Git} from '@docker/actions-toolkit/lib/git';
|
||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||
|
||||
let _tmpDir: string;
|
||||
export interface Context extends GithubContext {
|
||||
commitDate: Date;
|
||||
}
|
||||
|
||||
export interface Inputs {
|
||||
context: ContextSource;
|
||||
images: string[];
|
||||
tags: string[];
|
||||
flavor: string[];
|
||||
labels: string[];
|
||||
annotations: string[];
|
||||
sepTags: string;
|
||||
sepLabels: string;
|
||||
sepAnnotations: string;
|
||||
bakeTarget: 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 {
|
||||
return {
|
||||
images: getInputList('images'),
|
||||
tags: getInputList('tags', true),
|
||||
flavor: getInputList('flavor', true),
|
||||
labels: getInputList('labels', true),
|
||||
sepTags: core.getInput('sep-tags') || `\n`,
|
||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
||||
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
||||
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`,
|
||||
githubToken: core.getInput('github-token')
|
||||
};
|
||||
}
|
||||
|
||||
export function getInputList(name: string, ignoreComma?: boolean): string[] {
|
||||
const res: Array<string> = [];
|
||||
export enum ContextSource {
|
||||
workflow = 'workflow',
|
||||
git = 'git'
|
||||
}
|
||||
|
||||
const items = core.getInput(name);
|
||||
if (items == '') {
|
||||
return res;
|
||||
export async function getContext(source: ContextSource, toolkit: Toolkit): Promise<Context> {
|
||||
switch (source) {
|
||||
case ContextSource.workflow:
|
||||
return await getContextFromWorkflow(toolkit);
|
||||
case ContextSource.git:
|
||||
return await getContextFromGit();
|
||||
default:
|
||||
throw new Error(`Invalid context source: ${source}`);
|
||||
}
|
||||
}
|
||||
|
||||
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`;
|
||||
}
|
||||
|
||||
for (const output of csvparse(items, {
|
||||
columns: false,
|
||||
relax: true,
|
||||
comment: '#',
|
||||
relaxColumnCount: true,
|
||||
skipLinesWithEmptyValues: true
|
||||
}) as Array<string[]>) {
|
||||
if (output.length == 1) {
|
||||
res.push(output[0]);
|
||||
continue;
|
||||
} else if (!ignoreComma) {
|
||||
res.push(...output);
|
||||
continue;
|
||||
// DOCKER_METADATA_PR_HEAD_SHA env var can be used to set associated head
|
||||
// SHA instead of commit SHA that triggered the workflow on pull request
|
||||
// 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;
|
||||
}
|
||||
res.push(output.join(','));
|
||||
}
|
||||
|
||||
return res.filter(item => item).map(pat => pat.trim());
|
||||
return {
|
||||
commitDate: await getCommitDateFromWorkflow(context.sha, toolkit),
|
||||
...context
|
||||
} as Context;
|
||||
}
|
||||
|
||||
export const asyncForEach = async (array, callback) => {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
if (event.commits) {
|
||||
const commitDate = event.commits.find(x => x.id === sha)?.timestamp;
|
||||
if (commitDate) {
|
||||
return new Date(commitDate);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
|
||||
export function setOutput(name: string, value: unknown): void {
|
||||
issueCommand('set-output', {name}, value);
|
||||
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,5 +1,5 @@
|
||||
import {parse} from 'csv-parse/sync';
|
||||
import * as core from '@actions/core';
|
||||
import csvparse from 'csv-parse/lib/sync';
|
||||
|
||||
export interface Flavor {
|
||||
latest: string;
|
||||
@ -19,9 +19,9 @@ export function Transform(inputs: string[]): Flavor {
|
||||
};
|
||||
|
||||
for (const input of inputs) {
|
||||
const fields = csvparse(input, {
|
||||
const fields = parse(input, {
|
||||
relaxColumnCount: true,
|
||||
skipLinesWithEmptyValues: true
|
||||
skipEmptyLines: true
|
||||
})[0];
|
||||
let onlatestfor = '';
|
||||
for (const field of fields) {
|
||||
|
@ -1,18 +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);
|
||||
}
|
86
src/image.ts
Normal file
86
src/image.ts
Normal file
@ -0,0 +1,86 @@
|
||||
import {parse} from 'csv-parse/sync';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
export interface Image {
|
||||
name: string;
|
||||
enable: boolean;
|
||||
}
|
||||
|
||||
export function Transform(inputs: string[]): Image[] {
|
||||
let images: Image[] = [];
|
||||
|
||||
// backward compatibility with old format
|
||||
if (inputs.length == 1) {
|
||||
let newformat = false;
|
||||
const fields = parse(inputs[0], {
|
||||
relaxColumnCount: true,
|
||||
skipEmptyLines: true
|
||||
})[0];
|
||||
for (const field of fields) {
|
||||
const parts = field
|
||||
.toString()
|
||||
.split('=')
|
||||
.map(item => item.trim());
|
||||
if (parts.length == 1) {
|
||||
images.push({name: parts[0], enable: true});
|
||||
} else {
|
||||
newformat = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!newformat) {
|
||||
return output(images);
|
||||
}
|
||||
}
|
||||
|
||||
images = [];
|
||||
for (const input of inputs) {
|
||||
const image: Image = {name: '', enable: true};
|
||||
const fields = parse(input, {
|
||||
relaxColumnCount: true,
|
||||
skipEmptyLines: true
|
||||
})[0];
|
||||
for (const field of fields) {
|
||||
const parts = field
|
||||
.toString()
|
||||
.split('=')
|
||||
.map(item => item.trim());
|
||||
if (parts.length == 1) {
|
||||
image.name = parts[0];
|
||||
} else {
|
||||
const key = parts[0].toLowerCase();
|
||||
const value = parts[1];
|
||||
switch (key) {
|
||||
case 'name': {
|
||||
image.name = value;
|
||||
break;
|
||||
}
|
||||
case 'enable': {
|
||||
if (!['true', 'false'].includes(value)) {
|
||||
throw new Error(`Invalid enable attribute value: ${input}`);
|
||||
}
|
||||
image.enable = /true/i.test(value);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unknown image attribute: ${input}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (image.name.length == 0) {
|
||||
throw new Error(`Image name attribute empty: ${input}`);
|
||||
}
|
||||
images.push(image);
|
||||
}
|
||||
return output(images);
|
||||
}
|
||||
|
||||
function output(images: Image[]): Image[] {
|
||||
core.startGroup(`Processing images input`);
|
||||
for (const image of images) {
|
||||
core.info(`name=${image.name},enable=${image.enable}`);
|
||||
}
|
||||
core.endGroup();
|
||||
return images;
|
||||
}
|
140
src/main.ts
140
src/main.ts
@ -1,39 +1,48 @@
|
||||
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 {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() {
|
||||
try {
|
||||
const inputs: Inputs = await getInputs();
|
||||
if (inputs.images.length == 0) {
|
||||
throw new Error(`images input required`);
|
||||
import {getContext, getInputs, Inputs} from './context';
|
||||
import {Meta, Version} from './meta';
|
||||
|
||||
actionsToolkit.run(
|
||||
// main
|
||||
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(`sha: ${context.sha}`);
|
||||
core.info(`ref: ${context.ref}`);
|
||||
core.info(`workflow: ${context.workflow}`);
|
||||
core.info(`action: ${context.action}`);
|
||||
core.info(`actor: ${context.actor}`);
|
||||
core.info(`runNumber: ${context.runNumber}`);
|
||||
core.info(`runId: ${context.runId}`);
|
||||
core.info(`commitDate: ${context.commitDate}`);
|
||||
});
|
||||
|
||||
if (core.isDebug()) {
|
||||
await core.group(`Webhook payload`, async () => {
|
||||
core.info(JSON.stringify(context.payload, null, 2));
|
||||
});
|
||||
}
|
||||
|
||||
const context: Context = github.context();
|
||||
const repo: github.ReposGetResponseData = await github.repo(inputs.githubToken);
|
||||
core.startGroup(`Context info`);
|
||||
core.info(`eventName: ${context.eventName}`);
|
||||
core.info(`sha: ${context.sha}`);
|
||||
core.info(`ref: ${context.ref}`);
|
||||
core.info(`workflow: ${context.workflow}`);
|
||||
core.info(`action: ${context.action}`);
|
||||
core.info(`actor: ${context.actor}`);
|
||||
core.info(`runNumber: ${context.runNumber}`);
|
||||
core.info(`runId: ${context.runId}`);
|
||||
core.endGroup();
|
||||
|
||||
const meta: Meta = new Meta(inputs, context, repo);
|
||||
|
||||
const version: Version = meta.version;
|
||||
if (meta.version.main == undefined || meta.version.main.length == 0) {
|
||||
core.warning(`No Docker image version has been generated. Check tags input.`);
|
||||
} else {
|
||||
core.startGroup(`Docker image version`);
|
||||
core.info(version.main || '');
|
||||
core.endGroup();
|
||||
await core.group(`Docker image version`, async () => {
|
||||
core.info(version.main || '');
|
||||
});
|
||||
}
|
||||
setOutput('version', version.main || '');
|
||||
|
||||
@ -42,39 +51,70 @@ async function run() {
|
||||
if (tags.length == 0) {
|
||||
core.warning('No Docker tag has been generated. Check tags input.');
|
||||
} else {
|
||||
core.startGroup(`Docker tags`);
|
||||
for (const tag of tags) {
|
||||
core.info(tag);
|
||||
}
|
||||
core.endGroup();
|
||||
await core.group(`Docker tags`, async () => {
|
||||
for (const tag of tags) {
|
||||
core.info(tag);
|
||||
}
|
||||
});
|
||||
}
|
||||
setOutput('tags', tags.join(inputs.sepTags));
|
||||
|
||||
// Docker labels
|
||||
const labels: Array<string> = meta.getLabels();
|
||||
core.startGroup(`Docker labels`);
|
||||
for (const label of labels) {
|
||||
core.info(label);
|
||||
}
|
||||
core.endGroup();
|
||||
setOutput('labels', labels.join(inputs.sepLabels));
|
||||
await core.group(`Docker labels`, async () => {
|
||||
for (const label of labels) {
|
||||
core.info(label);
|
||||
}
|
||||
setOutput('labels', labels.join(inputs.sepLabels));
|
||||
});
|
||||
|
||||
// Annotations
|
||||
const annotationsRaw: Array<string> = meta.getAnnotations();
|
||||
const annotationsLevels = process.env.DOCKER_METADATA_ANNOTATIONS_LEVELS || 'manifest';
|
||||
await core.group(`Annotations`, async () => {
|
||||
const annotations: Array<string> = [];
|
||||
for (const level of annotationsLevels.split(',')) {
|
||||
annotations.push(
|
||||
...annotationsRaw.map(label => {
|
||||
const v = `${level}:${label}`;
|
||||
core.info(v);
|
||||
return v;
|
||||
})
|
||||
);
|
||||
}
|
||||
setOutput(`annotations`, annotations.join(inputs.sepAnnotations));
|
||||
});
|
||||
|
||||
// JSON
|
||||
const jsonOutput = meta.getJSON();
|
||||
core.startGroup(`JSON output`);
|
||||
core.info(JSON.stringify(jsonOutput, null, 2));
|
||||
core.endGroup();
|
||||
setOutput('json', jsonOutput);
|
||||
const jsonOutput = meta.getJSON(annotationsLevels.split(','));
|
||||
await core.group(`JSON output`, async () => {
|
||||
core.info(JSON.stringify(jsonOutput, null, 2));
|
||||
setOutput('json', JSON.stringify(jsonOutput));
|
||||
});
|
||||
|
||||
// Bake definition file
|
||||
const bakeFile: string = meta.getBakeFile();
|
||||
core.startGroup(`Bake definition file`);
|
||||
core.info(fs.readFileSync(bakeFile, 'utf8'));
|
||||
core.endGroup();
|
||||
setOutput('bake-file', bakeFile);
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
// Bake files
|
||||
for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) {
|
||||
const outputName = kind.split(':')[0];
|
||||
const bakeFile: string = meta.getBakeFile(kind);
|
||||
await core.group(`Bake file definition (${outputName})`, async () => {
|
||||
core.info(fs.readFileSync(bakeFile, 'utf8'));
|
||||
setOutput(`bake-file-${outputName}`, bakeFile);
|
||||
});
|
||||
}
|
||||
|
||||
// Bake file with tags and labels
|
||||
setOutput(`bake-file`, `${meta.getBakeFileTagsLabels()}`);
|
||||
}
|
||||
);
|
||||
|
||||
function setOutputAndEnv(name: string, value: string) {
|
||||
core.setOutput(name, value);
|
||||
core.exportVariable(`DOCKER_METADATA_OUTPUT_${name.replace(/\W/g, '_').toUpperCase()}`, value);
|
||||
}
|
||||
|
||||
run();
|
||||
function outputEnvEnabled(): boolean {
|
||||
if (process.env.DOCKER_METADATA_SET_OUTPUT_ENV) {
|
||||
return Util.parseBool(process.env.DOCKER_METADATA_SET_OUTPUT_ENV);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
328
src/meta.ts
328
src/meta.ts
@ -1,15 +1,19 @@
|
||||
import * as handlebars from 'handlebars';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import moment from 'moment';
|
||||
import moment from 'moment-timezone';
|
||||
import * as pep440 from '@renovate/pep440';
|
||||
import * as semver from 'semver';
|
||||
import {Inputs, tmpDir} from './context';
|
||||
import {ReposGetResponseData} from './github';
|
||||
import * as core from '@actions/core';
|
||||
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 tcl from './tag';
|
||||
import * as fcl from './flavor';
|
||||
import * as core from '@actions/core';
|
||||
import {Context} from '@actions/github/lib/context';
|
||||
|
||||
const defaultShortShaLength = 7;
|
||||
|
||||
export interface Version {
|
||||
main: string | undefined;
|
||||
@ -22,21 +26,17 @@ export class Meta {
|
||||
|
||||
private readonly inputs: Inputs;
|
||||
private readonly context: Context;
|
||||
private readonly repo: ReposGetResponseData;
|
||||
private readonly repo: GitHubRepo;
|
||||
private readonly images: icl.Image[];
|
||||
private readonly tags: tcl.Tag[];
|
||||
private readonly flavor: fcl.Flavor;
|
||||
private readonly date: Date;
|
||||
|
||||
constructor(inputs: Inputs, context: Context, repo: ReposGetResponseData) {
|
||||
// Needs to override Git reference with pr ref instead of upstream branch ref
|
||||
// for pull_request_target event
|
||||
if (/pull_request_target/.test(context.eventName)) {
|
||||
context.ref = `refs/pull/${context.payload.number}/merge`;
|
||||
}
|
||||
|
||||
constructor(inputs: Inputs, context: Context, repo: GitHubRepo) {
|
||||
this.inputs = inputs;
|
||||
this.context = context;
|
||||
this.repo = repo;
|
||||
this.images = icl.Transform(inputs.images);
|
||||
this.tags = tcl.Transform(inputs.tags);
|
||||
this.flavor = fcl.Transform(inputs.flavor);
|
||||
this.date = new Date();
|
||||
@ -51,7 +51,11 @@ export class Meta {
|
||||
};
|
||||
|
||||
for (const tag of this.tags) {
|
||||
if (!/true/i.test(tag.attrs['enable'])) {
|
||||
const enabled = this.setGlobalExp(tag.attrs['enable']);
|
||||
if (!['true', 'false'].includes(enabled)) {
|
||||
throw new Error(`Invalid value for enable attribute: ${enabled}`);
|
||||
}
|
||||
if (!/true/i.test(enabled)) {
|
||||
continue;
|
||||
}
|
||||
switch (tag.type) {
|
||||
@ -110,10 +114,36 @@ export class Meta {
|
||||
}
|
||||
|
||||
const currentDate = this.date;
|
||||
const commitDate = this.context.commitDate;
|
||||
const vraw = this.setValue(
|
||||
handlebars.compile(tag.attrs['pattern'])({
|
||||
date: function (format) {
|
||||
return moment(currentDate).utc().format(format);
|
||||
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);
|
||||
},
|
||||
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
|
||||
@ -140,7 +170,7 @@ export class Meta {
|
||||
|
||||
let latest = false;
|
||||
const sver = semver.parse(vraw, {
|
||||
includePrerelease: true
|
||||
loose: true
|
||||
});
|
||||
if (semver.prerelease(vraw)) {
|
||||
if (Meta.isRawStatement(tag.attrs['pattern'])) {
|
||||
@ -216,7 +246,7 @@ export class Meta {
|
||||
if (tag.attrs['value'].length > 0) {
|
||||
vraw = this.setGlobalExp(tag.attrs['value']);
|
||||
} else {
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||
vraw = this.context.ref.replace(/^refs\/tags\//g, '');
|
||||
}
|
||||
|
||||
let tmatch;
|
||||
@ -243,7 +273,7 @@ export class Meta {
|
||||
if (!/^refs\/heads\//.test(this.context.ref)) {
|
||||
return version;
|
||||
}
|
||||
const vraw = this.setValue(this.context.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-'), tag);
|
||||
const vraw = this.setValue(this.context.ref.replace(/^refs\/heads\//g, ''), tag);
|
||||
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true');
|
||||
}
|
||||
|
||||
@ -251,7 +281,7 @@ export class Meta {
|
||||
if (!/^refs\/tags\//.test(this.context.ref)) {
|
||||
return version;
|
||||
}
|
||||
const vraw = this.setValue(this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-'), tag);
|
||||
const vraw = this.setValue(this.context.ref.replace(/^refs\/tags\//g, ''), tag);
|
||||
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? true : this.flavor.latest == 'true');
|
||||
}
|
||||
|
||||
@ -269,7 +299,7 @@ export class Meta {
|
||||
return version;
|
||||
}
|
||||
|
||||
const val = this.context.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-');
|
||||
const val = this.context.ref.replace(/^refs\/heads\//g, '');
|
||||
if (tag.attrs['branch'].length == 0) {
|
||||
tag.attrs['branch'] = this.repo.default_branch;
|
||||
}
|
||||
@ -293,7 +323,7 @@ export class Meta {
|
||||
|
||||
let val = this.context.sha;
|
||||
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);
|
||||
@ -304,6 +334,7 @@ export class Meta {
|
||||
if (val.length == 0) {
|
||||
return version;
|
||||
}
|
||||
val = Meta.sanitizeTag(val);
|
||||
if (version.main == undefined) {
|
||||
version.main = val;
|
||||
} else if (val !== version.main) {
|
||||
@ -341,61 +372,142 @@ export class Meta {
|
||||
return val;
|
||||
}
|
||||
|
||||
private setGlobalExp(val): string {
|
||||
const ctx = this.context;
|
||||
private setGlobalExp(val: string): string {
|
||||
const context = this.context;
|
||||
const currentDate = this.date;
|
||||
const commitDate = this.context.commitDate;
|
||||
return handlebars.compile(val)({
|
||||
branch: function () {
|
||||
if (!/^refs\/heads\//.test(ctx.ref)) {
|
||||
if (!/^refs\/heads\//.test(context.ref)) {
|
||||
return '';
|
||||
}
|
||||
return ctx.ref.replace(/^refs\/heads\//g, '').replace(/[^a-zA-Z0-9._-]+/g, '-');
|
||||
return context.ref.replace(/^refs\/heads\//g, '');
|
||||
},
|
||||
tag: function () {
|
||||
if (!/^refs\/tags\//.test(ctx.ref)) {
|
||||
if (!/^refs\/tags\//.test(context.ref)) {
|
||||
return '';
|
||||
}
|
||||
return ctx.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
|
||||
return context.ref.replace(/^refs\/tags\//g, '');
|
||||
},
|
||||
sha: function () {
|
||||
return ctx.sha.substr(0, 7);
|
||||
return Meta.shortSha(context.sha);
|
||||
},
|
||||
base_ref: function () {
|
||||
if (/^refs\/tags\//.test(ctx.ref)) {
|
||||
return ctx.payload?.base_ref.replace(/^refs\/heads\//g, '').replace(/\//g, '-');
|
||||
if (/^refs\/tags\//.test(context.ref) && context.payload?.base_ref != undefined) {
|
||||
return context.payload.base_ref.replace(/^refs\/heads\//g, '');
|
||||
}
|
||||
if (/^refs\/pull\//.test(ctx.ref)) {
|
||||
return ctx.payload?.pull_request?.base?.ref;
|
||||
// FIXME: keep this for backward compatibility even if doesn't always seem
|
||||
// to return the expected branch. See the comment below.
|
||||
if (/^refs\/pull\//.test(context.ref) && context.payload?.pull_request?.base?.ref != undefined) {
|
||||
return context.payload.pull_request.base.ref;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
date: function (format) {
|
||||
return moment(currentDate).utc().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);
|
||||
},
|
||||
is_default_branch: function () {
|
||||
const branch = context.ref.replace(/^refs\/heads\//g, '');
|
||||
// TODO: "base_ref" is available in the push payload but doesn't always seem to
|
||||
// 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
|
||||
// more context: https://github.com/docker/metadata-action/pull/192#discussion_r854673012
|
||||
// if (/^refs\/tags\//.test(context.ref) && context.payload?.base_ref != undefined) {
|
||||
// branch = context.payload.base_ref.replace(/^refs\/heads\//g, '');
|
||||
// }
|
||||
if (branch == undefined || branch.length == 0) {
|
||||
return 'false';
|
||||
}
|
||||
if (context.payload?.repository?.default_branch == branch) {
|
||||
return 'true';
|
||||
}
|
||||
// following events always trigger for last commit on default branch
|
||||
// https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
|
||||
if (/create/.test(context.eventName) || /discussion/.test(context.eventName) || /issues/.test(context.eventName) || /schedule/.test(context.eventName)) {
|
||||
return 'true';
|
||||
}
|
||||
return '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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private getImageNames(): Array<string> {
|
||||
const images: Array<string> = [];
|
||||
for (const image of this.images) {
|
||||
if (!image.enable) {
|
||||
continue;
|
||||
}
|
||||
images.push(Meta.sanitizeImageName(image.name));
|
||||
}
|
||||
return images;
|
||||
}
|
||||
|
||||
public getTags(): Array<string> {
|
||||
if (!this.version.main) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const tags: Array<string> = [];
|
||||
for (const image of this.inputs.images) {
|
||||
const imageLc = image.toLowerCase();
|
||||
tags.push(`${imageLc}:${this.version.main}`);
|
||||
const generateTags = (imageName: string, version: string): Array<string> => {
|
||||
const tags: Array<string> = [];
|
||||
const prefix = imageName !== '' ? `${imageName}:` : '';
|
||||
tags.push(`${prefix}${version}`);
|
||||
for (const partial of this.version.partial) {
|
||||
tags.push(`${imageLc}:${partial}`);
|
||||
tags.push(`${prefix}${partial}`);
|
||||
}
|
||||
if (this.version.latest) {
|
||||
tags.push(`${imageLc}:${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(`${prefix}${Meta.sanitizeTag(latestTag)}`);
|
||||
}
|
||||
return tags;
|
||||
};
|
||||
|
||||
const tags: Array<string> = [];
|
||||
const images = this.getImageNames();
|
||||
if (images.length > 0) {
|
||||
for (const imageName of images) {
|
||||
tags.push(...generateTags(imageName, this.version.main));
|
||||
}
|
||||
} else {
|
||||
tags.push(...generateTags('', this.version.main));
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
public getLabels(): Array<string> {
|
||||
const labels: Array<string> = [
|
||||
return this.getOCIAnnotationsWithCustoms(this.inputs.labels);
|
||||
}
|
||||
|
||||
public getAnnotations(): Array<string> {
|
||||
return this.getOCIAnnotationsWithCustoms(this.inputs.annotations);
|
||||
}
|
||||
|
||||
private getOCIAnnotationsWithCustoms(extra: string[]): Array<string> {
|
||||
const res: Array<string> = [
|
||||
`org.opencontainers.image.title=${this.repo.name || ''}`,
|
||||
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
||||
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
||||
@ -405,11 +517,28 @@ export class Meta {
|
||||
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||
];
|
||||
labels.push(...this.inputs.labels);
|
||||
return labels;
|
||||
extra.forEach(label => {
|
||||
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 {
|
||||
tags: this.getTags(),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
@ -419,39 +548,96 @@ export class Meta {
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {})
|
||||
}, {}),
|
||||
annotations: annotations
|
||||
};
|
||||
}
|
||||
|
||||
public getBakeFile(): string {
|
||||
const bakeFile = path.join(tmpDir(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep);
|
||||
fs.writeFileSync(
|
||||
bakeFile,
|
||||
JSON.stringify(
|
||||
public getBakeFile(kind: string): string {
|
||||
if (kind == 'tags') {
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
target: {
|
||||
[this.inputs.bakeTarget]: {
|
||||
tags: this.getTags(),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {}),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.inputs.images.join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
}
|
||||
tags: this.getTags(),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
},
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
kind
|
||||
);
|
||||
} else if (kind == 'labels') {
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {})
|
||||
},
|
||||
kind
|
||||
);
|
||||
} else if (kind.startsWith('annotations:')) {
|
||||
const name = kind.split(':')[0];
|
||||
const annotations: Array<string> = [];
|
||||
for (const level of kind.split(':')[1].split(',')) {
|
||||
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||
}
|
||||
return this.generateBakeFile(
|
||||
{
|
||||
annotations: annotations
|
||||
},
|
||||
name
|
||||
);
|
||||
}
|
||||
throw new Error(`Unknown bake file type: ${kind}`);
|
||||
}
|
||||
|
||||
public getBakeFileTagsLabels(): string {
|
||||
return this.generateBakeFile({
|
||||
tags: this.getTags(),
|
||||
labels: this.getLabels().reduce((res, label) => {
|
||||
const matches = label.match(/([^=]*)=(.*)/);
|
||||
if (!matches) {
|
||||
return res;
|
||||
}
|
||||
res[matches[1]] = matches[2];
|
||||
return res;
|
||||
}, {}),
|
||||
args: {
|
||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||
DOCKER_META_VERSION: this.version.main
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private static sanitizeImageName(name: string): string {
|
||||
return name.toLowerCase();
|
||||
}
|
||||
|
||||
private static sanitizeTag(tag: string): string {
|
||||
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
||||
}
|
||||
|
||||
private static shortSha(sha: string): string {
|
||||
let shortShaLength = defaultShortShaLength;
|
||||
if (process.env.DOCKER_METADATA_SHORT_SHA_LENGTH) {
|
||||
if (isNaN(Number(process.env.DOCKER_METADATA_SHORT_SHA_LENGTH))) {
|
||||
throw new Error(`DOCKER_METADATA_SHORT_SHA_LENGTH is not a valid number: ${process.env.DOCKER_METADATA_SHORT_SHA_LENGTH}`);
|
||||
}
|
||||
shortShaLength = Number(process.env.DOCKER_METADATA_SHORT_SHA_LENGTH);
|
||||
}
|
||||
if (shortShaLength >= sha.length) {
|
||||
return sha;
|
||||
}
|
||||
return sha.substring(0, shortShaLength);
|
||||
}
|
||||
}
|
||||
|
11
src/tag.ts
11
src/tag.ts
@ -1,4 +1,4 @@
|
||||
import csvparse from 'csv-parse/lib/sync';
|
||||
import {parse} from 'csv-parse/sync';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
export enum Type {
|
||||
@ -86,16 +86,16 @@ export function Transform(inputs: string[]): Tag[] {
|
||||
}
|
||||
|
||||
export function Parse(s: string): Tag {
|
||||
const fields = csvparse(s, {
|
||||
const fields = parse(s, {
|
||||
relaxColumnCount: true,
|
||||
skipLinesWithEmptyValues: true
|
||||
skipEmptyLines: true
|
||||
})[0];
|
||||
|
||||
const tag = new Tag();
|
||||
for (const field of fields) {
|
||||
const parts = field
|
||||
.toString()
|
||||
.split('=')
|
||||
.split(/(?<=^[^=]+?)=/)
|
||||
.map(item => item.trim());
|
||||
if (parts.length == 1) {
|
||||
tag.attrs['value'] = parts[0];
|
||||
@ -206,9 +206,6 @@ export function Parse(s: string): Tag {
|
||||
if (!Object.prototype.hasOwnProperty.call(tag.attrs, 'priority')) {
|
||||
tag.attrs['priority'] = DefaultPriorities[tag.type];
|
||||
}
|
||||
if (!['true', 'false'].includes(tag.attrs['enable'])) {
|
||||
throw new Error(`Invalid value for enable attribute: ${tag.attrs['enable']}`);
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM alpine
|
||||
|
||||
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": {
|
||||
"esModuleInterop": true,
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"strict": true,
|
||||
"newLine": "lf",
|
||||
"outDir": "./lib",
|
||||
"rootDir": "./src",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
"resolveJsonModule": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
},
|
||||
"exclude": [
|
||||
"./__mocks__/**/*",
|
||||
"./__tests__/**/*",
|
||||
"./lib/**/*",
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"jest.config.ts"
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user