Compare commits

...

26 Commits
v2 ... v3.3.0

Author SHA1 Message Date
CrazyMax
98669ae865 Merge pull request #97 from crazy-max/fix-pr-event
Fix `pull_request_target` event
2021-05-25 18:47:42 +02:00
CrazyMax
85f4f732f2 Fix pull_request_target event
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-25 18:45:38 +02:00
CrazyMax
013e892d4a Merge pull request #93 from docker/dependabot/npm_and_yarn/actions/core-1.3.0
Bump @actions/core from 1.2.7 to 1.3.0
2021-05-25 02:39:40 +02:00
CrazyMax
4a03258546 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-25 02:37:56 +02:00
dependabot[bot]
3c951ec458 Bump @actions/core from 1.2.7 to 1.3.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.7 to 1.3.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 00:34:56 +00:00
CrazyMax
84dbd57663 Merge pull request #94 from docker/dependabot/npm_and_yarn/actions/github-5.0.0
Bump @actions/github from 4.0.0 to 5.0.0
2021-05-25 02:09:27 +02:00
CrazyMax
28d7c8bbcd Fix octokit definition object
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-25 02:07:31 +02:00
dependabot[bot]
e5c54f2159 Bump @actions/github from 4.0.0 to 5.0.0
Bumps [@actions/github](https://github.com/actions/toolkit/tree/HEAD/packages/github) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/github/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/github)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 23:36:59 +00:00
CrazyMax
4742d2f661 Merge pull request #92 from crazy-max/dependabot-config
Update dependabot config
2021-05-25 01:34:51 +02:00
CrazyMax
d605601d46 Update dependabot config
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-25 01:32:47 +02:00
CrazyMax
9987462005 Merge pull request #91 from crazy-max/pr_target_event
Handle `pull_request_target` event
2021-05-23 15:28:23 +02:00
CrazyMax
4d088f5efc Handle pull_request_target event
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-23 03:54:23 +02:00
CrazyMax
e856afadf9 Merge pull request #89 from crazy-max/json-output
Add json output
2021-05-22 22:12:28 +02:00
CrazyMax
e6f3e4aa91 Add json output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-22 21:23:06 +02:00
CrazyMax
01dc739d69 Merge pull request #83 from crazy-max/fix-readme
Fix readme
2021-05-13 21:51:40 +02:00
CrazyMax
a1417fcdec Fix readme
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-13 21:46:07 +02:00
CrazyMax
12528c4f05 Merge pull request #81 from crazy-max/sha-format
Add format attribute for type=sha
2021-05-11 20:28:33 +02:00
CrazyMax
8841ef4bb7 Add format attribute for type=sha
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-11 20:14:27 +02:00
CrazyMax
2af9c6a52b Merge pull request #78 from crazy-max/upgrade-notes
v3 upgrade notes
2021-05-10 16:05:16 +02:00
CrazyMax
1239e23120 v3 upgrade notes
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-10 16:03:37 +02:00
CrazyMax
8d3d13fe48 Merge pull request #77 from crazy-max/rename-bake-target
Rename bake target
2021-05-10 15:59:40 +02:00
CrazyMax
ed01528979 Rename bake target
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-05-10 15:54:35 +02:00
CrazyMax
c8b87a08b5 Merge pull request #76 from docker/fix-action-name
Fix action name
2021-05-10 15:42:22 +02:00
CrazyMax
280367084a Fix action name 2021-05-10 15:39:06 +02:00
CrazyMax
c0bab712bd Merge pull request #75 from docker/move-dockerorg
Move to Docker org
2021-05-10 15:22:57 +02:00
CrazyMax
9ceaaf86cd Move to Docker org 2021-05-08 01:41:46 +02:00
33 changed files with 2084 additions and 786 deletions

View File

@@ -7,14 +7,14 @@ to the public under the [project's open source license](LICENSE).
## Submitting a pull request ## Submitting a pull request
1. [Fork](https://github.com/crazy-max/ghaction-docker-meta/fork) and clone the repository 1. [Fork](https://github.com/docker/metadata-action/fork) and clone the repository
2. Configure and install the dependencies: `yarn install` 2. Configure and install the dependencies: `yarn install`
3. Create a new branch: `git checkout -b my-branch-name` 3. Create a new branch: `git checkout -b my-branch-name`
4. Make your changes 4. Make your changes
5. Make sure the tests pass: `docker buildx bake test` 5. Make sure the tests pass: `docker buildx bake test`
6. Format code and build javascript artifacts: `docker buildx bake pre-checkin` 6. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
7. Validate all code has correctly formatted and built: `docker buildx bake validate` 7. Validate all code has correctly formatted and built: `docker buildx bake validate`
8. Push to your fork and [submit a pull request](https://github.com/crazy-max/ghaction-docker-meta/compare) 8. Push to your fork and [submit a pull request](https://github.com/docker/metadata-action/compare)
9. Pat your self on the back and wait for your pull request to be reviewed and merged. 9. Pat your self on the back and wait for your pull request to be reviewed and merged.
Here are a few things you can do that will increase the likelihood of your pull request being accepted: Here are a few things you can do that will increase the likelihood of your pull request being accepted:

2
.github/FUNDING.yml vendored
View File

@@ -1,2 +0,0 @@
github: crazy-max
custom: https://www.paypal.me/crazyws

View File

@@ -13,11 +13,11 @@ about: Create a report to help us improve
#### Expected behaviour #### Expected behaviour
> Tell me what should happen > Tell us what should happen
#### Actual behaviour #### Actual behaviour
> Tell me what happens instead > Tell us what happens instead
### Configuration ### Configuration

13
.github/SUPPORT.md vendored
View File

@@ -1,10 +1,13 @@
# Support [![](https://isitmaintained.com/badge/resolution/crazy-max/ghaction-docker-meta.svg)](https://isitmaintained.com/project/crazy-max/ghaction-docker-meta) # Support [![](https://isitmaintained.com/badge/resolution/docker/metadata-action.svg)](https://isitmaintained.com/project/docker/metadata-action)
## Reporting an issue ## Reporting an issue
Please do a search in [open issues](https://github.com/crazy-max/ghaction-docker-meta/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed. 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. 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: - upvote
@@ -21,9 +24,9 @@ File a single issue per problem and feature request.
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix. 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/crazy-max/ghaction-docker-meta/issues/new/choose)! You are now ready to [create a new issue](https://github.com/docker/metadata-action/issues/new/choose)!
## Closure policy ## 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 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 my discretion. * Issues that go a week without a response from original poster are subject to closure at our discretion.

View File

@@ -4,8 +4,6 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: "daily"
time: "06:00"
timezone: "Europe/Paris"
labels: labels:
- ":game_die: dependencies" - ":game_die: dependencies"
- ":robot: bot" - ":robot: bot"
@@ -13,8 +11,6 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: "daily"
time: "06:00"
timezone: "Europe/Paris"
allow: allow:
- dependency-type: "production" - dependency-type: "production"
labels: labels:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

85
.github/labels.yml vendored
View File

@@ -1,85 +0,0 @@
## more info https://github.com/crazy-max/ghaction-github-labeler
- # automerge
name: ":bell: automerge"
color: "8f4fbc"
description: ""
- # bot
name: ":robot: bot"
color: "69cde9"
description: ""
- # bug
name: ":bug: bug"
color: "b60205"
description: ""
- # dependencies
name: ":game_die: dependencies"
color: "0366d6"
description: ""
- # documentation
name: ":memo: documentation"
color: "c5def5"
description: ""
- # duplicate
name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- # enhancement
name: ":sparkles: enhancement"
color: "0054ca"
description: ""
- # feature request
name: ":bulb: feature request"
color: "0e8a16"
description: ""
- # feedback
name: ":mega: feedback"
color: "03a9f4"
description: ""
- # future maybe
name: ":rocket: future maybe"
color: "fef2c0"
description: ""
- # good first issue
name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- # help wanted
name: ":pray: help wanted"
color: "4caf50"
description: ""
- # invalid
name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
- # investigate
name: ":mag: investigate"
color: "e6625b"
description: ""
- # needs more info
name: ":thinking: needs more info"
color: "795548"
description: ""
- # pinned
name: ":pushpin: pinned"
color: "28008e"
description: ""
- # question
name: ":question: question"
color: "3f51b5"
description: ""
- # sponsor
name: ":sparkling_heart: sponsor"
color: "fedbf0"
description: ""
- # stale
name: ":skull: stale"
color: "237da0"
description: ""
- # upstream
name: ":eyes: upstream"
color: "fbca04"
description: ""
- # wontfix
name: ":coffin: wontfix"
color: "ffffff"
description: ""

BIN
.github/metadata-action.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

19
.github/stale.yml vendored
View File

@@ -1,19 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- ":pushpin: pinned"
- ":game_die: dependencies"
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Label to use when marking an issue as stale
staleLabel: ":skull: stale"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

View File

@@ -165,6 +165,30 @@ jobs:
org.opencontainers.image.description=Another description org.opencontainers.image.description=Another description
org.opencontainers.image.vendor=MyCompany org.opencontainers.image.vendor=MyCompany
json:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: ./
with:
images: |
${{ env.DOCKER_IMAGE }}
ghcr.io/name/app
labels: |
maintainer=CrazyMax
-
name: JSON output
run: |
echo "maintainer=${{ fromJSON(steps.meta.outputs.json).labels['maintainer'] }}"
echo "version=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}"
echo "revision=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}"
echo "created=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}"
docker-push: docker-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:

View File

@@ -1,18 +0,0 @@
name: label-sponsor
on:
issues:
types:
- 'opened'
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Set sponsor label
uses: JasonEtco/is-sponsor-label-action@024ac24f8b170abce078cad4ee748852369853c8
with:
label: ":sparkling_heart: sponsor"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,20 +0,0 @@
name: labels
on:
push:
branches:
- 'master'
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v3

View File

@@ -5,14 +5,10 @@ on:
branches: branches:
- 'master' - 'master'
- 'releases/v*' - 'releases/v*'
paths-ignore:
- '**.md'
pull_request: pull_request:
branches: branches:
- 'master' - 'master'
- 'releases/v*' - 'releases/v*'
paths-ignore:
- '**.md'
jobs: jobs:
test: test:

View File

@@ -1,146 +0,0 @@
# Changelog
## 2.5.0 (2021/05/08)
* Major version zero doc (#74)
* Bump hosted-git-info from 2.8.8 to 2.8.9 (#73)
* Bump lodash from 4.17.20 to 4.17.21 (#72)
* Handle global expressions (#71)
## 2.4.0 (2021/04/30)
* Add `bake-target` input (#69)
* Fix setOutput (#67)
* Bump csv-parse from 4.15.3 to 4.15.4 (#65)
* Bump @actions/core from 1.2.6 to 1.2.7 (#64)
## 2.3.0 (2021/04/07)
* Allow overriding flavor (#63)
* Prefix/suffix not taken into account for `match`, `semver` and `schedule` types (#62)
## 2.2.1 (2021/04/05)
* Skip and display warning if tag does not match (#59)
## 2.2.0 (2021/04/03)
* Improve logging (#58)
* Fix README (#56)
## 2.1.1 (2021/03/30)
* Fix `enable` tag attribute (#53)
* Bump y18n from 4.0.0 to 4.0.1 (#54)
## 2.1.0 (2021/03/29)
* Bump semver from 7.3.4 to 7.3.5 (#49)
* Enhance workflow (#51)
## 2.0.0 (2021/03/29)
This release includes significant changes (#50). Please read the [upgrade notes](UPGRADE.md) for a smooth migration.
`v1` is still available through [`releases/v1` branch](https://github.com/crazy-max/ghaction-docker-meta/tree/releases/v1).
* Add `tags` input
* Inputs `tag-sha`, `tag-edge`, `tag-edge-branch`, `tag-semver`, `tag-match`, `tag-match-group`, `tag-schedule`, `tag-custom`, `tag-custom-only` have been removed and are now handled through the new `tags` input
* Input `label-custom` renamed `labels`
* Add `flavor` input to handle a global prefix, suffix and latest tag behavior (#13 #15 #41)
* Input `tag-latest` removed (use `flavor` input instead)
* Manage tag sorting through `priority` attribute in `tags` input (#27)
* Explicit control over the conditions of each tag through `enable` attribute in `tags` input (#30)
* Allow `semver` and `match` parsing for custom values (#25 #30)
* Display warning message if not tag generated
## 1.12.0 (2021/03/19)
* Ignore commas for `label-custom` input (#48)
* Bump handlebars from 4.7.6 to 4.7.7 (#44)
* Bump csv-parse from 4.14.2 to 4.15.3 (#42 #45)
## 1.11.0 (2020/12/24)
* Inject `DOCKER_META_IMAGES` and `DOCKER_META_VERSION` args in bake definition (#37)
## 1.10.1 (2020/12/24)
* Missing entry in `action.yml`
## 1.10.0 (2020/12/24)
* Add `bake-file` output (#36)
* Add `label-custom` input (#35)
* Bump node-notifier from 8.0.0 to 8.0.1 (#33)
* Update dev workflow (#32)
## 1.9.1 (2020/12/07)
* Replace forbidden chars derived from branch name (#31)
* Bump semver from 7.3.2 to 7.3.4 (#26)
## 1.9.0 (2020/12/04)
* Allow to add custom tags (#24)
* Allow to disable latest tag (#23)
* Warn on invalid semver (#22)
* Avoid unnecessary calls to version (#21)
## 1.8.5 (2020/11/24)
* Use sepLabels when joining labels for output (#17)
## 1.8.4 (2020/11/20)
* Pre-release (rc, beta, alpha) will only extend `{{version}}` as tag for `tag-semver`
## 1.8.3 (2020/11/20)
* Lowercase image name (#16)
## 1.8.2 (2020/11/18)
* Remove duplicated tags
## 1.8.1 (2020/11/18)
* Missing input in `action.yml`
## 1.8.0 (2020/11/17)
* Handle semver tags (#14)
## 1.7.0 (2020/10/31)
* Use `repo.html_url` for `org.opencontainers.image.source` label to be able to display README on GHCR
* Handle `tag-match-latest` on Git tag event (#8)
## 1.6.0 (2020/10/28)
* Generate latest tag by default on push tag event (#5)
## 1.5.0 (2020/10/27)
* Add `tag-match-group` input to choose group to get if `tag-match` matches
* Check `tag-match` is a valid regex
## 1.4.0 (2020/10/27)
* Use RegExp to match against a Git tag instead of coerce
## 1.3.0 (2020/10/26)
* Set latest tag only if matches with a pattern
## 1.2.0 (2020/10/26)
* Coerces Git tag to semver (#3)
## 1.1.0 (2020/10/25)
* Allow to templatize schedule tag (#1)
* Allow to disable edge branch tagging (#2)
## 1.0.0 (2020/10/25)
* Initial version

204
LICENSE
View File

@@ -1,21 +1,191 @@
MIT License
Copyright (c) 2020-2021 CrazyMax Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
Permission is hereby granted, free of charge, to any person obtaining a copy TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all 1. Definitions.
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR "License" shall mean the terms and conditions for use, reproduction,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, and distribution as defined by Sections 1 through 9 of this document.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "Licensor" shall mean the copyright owner or entity authorized by
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, the copyright owner that is granting the License.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. "Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2013-2018 Docker, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,22 +1,14 @@
[![GitHub release](https://img.shields.io/github/release/crazy-max/ghaction-docker-meta.svg?style=flat-square)](https://github.com/crazy-max/ghaction-docker-meta/releases/latest) [![GitHub release](https://img.shields.io/github/release/docker/metadata-action.svg?style=flat-square)](https://github.com/docker/metadata-action/releases/latest)
[![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--meta-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-meta) [![GitHub marketplace](https://img.shields.io/badge/marketplace-docker--metadata--action-blue?logo=github&style=flat-square)](https://github.com/marketplace/actions/docker-metadata-action)
[![Test workflow](https://img.shields.io/github/workflow/status/crazy-max/ghaction-docker-meta/test?label=test&logo=github&style=flat-square)](https://github.com/crazy-max/ghaction-docker-meta/actions?workflow=test) [![Test workflow](https://img.shields.io/github/workflow/status/docker/metadata-action/test?label=test&logo=github&style=flat-square)](https://github.com/docker/metadata-action/actions?workflow=test)
[![Codecov](https://img.shields.io/codecov/c/github/crazy-max/ghaction-docker-meta?logo=codecov&style=flat-square)](https://codecov.io/gh/crazy-max/ghaction-docker-meta) [![Codecov](https://img.shields.io/codecov/c/github/docker/metadata-action?logo=codecov&style=flat-square)](https://codecov.io/gh/docker/metadata-action)
[![Become a sponsor](https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square)](https://github.com/sponsors/crazy-max)
[![Paypal Donate](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square)](https://www.paypal.me/crazyws)
## Upgrade from v1
`v2` of this action includes significant changes. Please read the [upgrade notes](UPGRADE.md) for a smooth migration.
## About ## About
GitHub Action to extract metadata (tags, labels) for Docker. This action is particularly useful if used with GitHub Action to extract metadata (tags, labels) for Docker. This action is particularly useful if used with
[Docker Build Push](https://github.com/docker/build-push-action) action. [Docker Build Push](https://github.com/docker/build-push-action) action.
If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitHub Actions! ![Screenshot](.github/metadata-action.png)
![Screenshot](.github/ghaction-docker-meta.png)
___ ___
@@ -40,10 +32,9 @@ ___
* [Latest tag](#latest-tag) * [Latest tag](#latest-tag)
* [Global expressions](#global-expressions) * [Global expressions](#global-expressions)
* [Major version zero](#major-version-zero) * [Major version zero](#major-version-zero)
* [JSON output object](#json-output-object)
* [Overwrite labels](#overwrite-labels) * [Overwrite labels](#overwrite-labels)
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot) * [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot)
* [Contributing](#contributing)
* [License](#license)
## Usage ## Usage
@@ -72,7 +63,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
- -
@@ -125,7 +116,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
tags: | tags: |
@@ -162,14 +153,14 @@ jobs:
This action also handles a bake definition file that can be used with the This action also handles a bake definition file that can be used with the
[Docker Bake action](https://github.com/docker/bake-action). You just have to declare an empty target named [Docker Bake action](https://github.com/docker/bake-action). You just have to declare an empty target named
`ghaction-docker-meta` and inherit from it. `docker-metadata-action` and inherit from it.
```hcl ```hcl
// docker-bake.hcl // docker-bake.hcl
target "ghaction-docker-meta" {} target "docker-metadata-action" {}
target "build" { target "build" {
inherits = ["ghaction-docker-meta"] inherits = ["docker-metadata-action"]
context = "./" context = "./"
dockerfile = "Dockerfile" dockerfile = "Dockerfile"
platforms = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le"] platforms = ["linux/amd64", "linux/arm/v6", "linux/arm/v7", "linux/arm64", "linux/386", "linux/ppc64le"]
@@ -196,7 +187,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
tags: | tags: |
@@ -220,7 +211,7 @@ Content of `${{ steps.meta.outputs.bake-file }}` file will look like this with `
```json ```json
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"name/app:1.2.3", "name/app:1.2.3",
"name/app:1.2", "name/app:1.2",
@@ -273,7 +264,7 @@ Following inputs can be used as `step.with` keys
| `labels` | List | List of custom labels | | `labels` | List | List of custom labels |
| `sep-tags` | String | Separator to use for tags output (default `\n`) | | `sep-tags` | String | Separator to use for tags output (default `\n`) |
| `sep-labels` | String | Separator to use for labels output (default `\n`) | | `sep-labels` | String | Separator to use for labels output (default `\n`) |
| `bake-target` | String | Bake target name (default `ghaction-docker-meta`) | | `bake-target` | String | Bake target name (default `docker-metadata-action`) |
### outputs ### outputs
@@ -284,6 +275,7 @@ Following outputs are available
| `version` | String | Docker image version | | `version` | String | Docker image version |
| `tags` | String | Docker tags | | `tags` | String | Docker tags |
| `labels` | String | Docker labels | | `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 | | `bake-file` | File | [Bake definition file](https://github.com/docker/buildx#file-definition) path |
## `flavor` input ## `flavor` input
@@ -534,17 +526,19 @@ tags: |
```yaml ```yaml
tags: | tags: |
# minimal # minimal (short sha)
type=sha type=sha
# full length sha
type=sha,format=long
``` ```
Output Git short commit as Docker tag like `sha-ad132f5`. Output Git short commit (or long if specified) as Docker tag like `sha-ad132f5`.
Extended attributes and default values: Extended attributes and default values:
```yaml ```yaml
tags: | tags: |
type=sha,enable=true,priority=100,prefix=sha-,suffix= type=sha,enable=true,priority=100,prefix=sha-,suffix=,format=short
``` ```
## Notes ## Notes
@@ -594,6 +588,30 @@ tags: |
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
``` ```
### 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/reference/context-and-expression-syntax-for-github-actions#fromjson):
```yaml
-
name: Docker meta
uses: docker/metadata-action@v3
id: meta
with:
images: name/app
-
name: Build and push
uses: docker/build-push-action@v2
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDTIME=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
```
### Overwrite labels ### Overwrite labels
If some of the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md) If some of the [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
@@ -602,8 +620,8 @@ labels generated are not suitable, you can overwrite them like this:
```yaml ```yaml
- -
name: Docker meta name: Docker meta
id: docker_meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
labels: | labels: |
@@ -628,18 +646,3 @@ updates:
schedule: schedule:
interval: "daily" interval: "daily"
``` ```
## Contributing
Want to contribute? Awesome! The most basic way to show your support is to star :star2: the project,
or to raise issues :speech_balloon:. If you want to open a pull request, please read the
[contributing guidelines](.github/CONTRIBUTING.md).
You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) or by
making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely!
Thanks again for your support, it is much appreciated! :pray:
## License
MIT. See `LICENSE` for more details.

View File

@@ -1,5 +1,10 @@
# Upgrade notes # 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 ## v1 to v2
* [inputs](#inputs) * [inputs](#inputs)
@@ -131,7 +136,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v1 uses: docker/metadata-action@v1
with: with:
images: name/app images: name/app
- -
@@ -175,7 +180,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
- -
@@ -221,7 +226,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v1 uses: docker/metadata-action@v1
with: with:
images: name/app images: name/app
tag-semver: | tag-semver: |
@@ -268,7 +273,7 @@ jobs:
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: crazy-max/ghaction-docker-meta@v2 uses: docker/metadata-action@v3
with: with:
images: name/app images: name/app
tags: | tags: |

View File

@@ -5,7 +5,7 @@ import * as path from 'path';
import * as context from '../src/context'; import * as context from '../src/context';
jest.spyOn(context, 'tmpDir').mockImplementation((): string => { jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
const tmpDir = path.join('/tmp/.ghaction-docker-meta-jest').split(path.sep).join(path.posix.sep); const tmpDir = path.join('/tmp/.docker-metadata-action-jest').split(path.sep).join(path.posix.sep);
if (!fs.existsSync(tmpDir)) { if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true}); fs.mkdirSync(tmpDir, {recursive: true});
} }

View File

@@ -0,0 +1,25 @@
GITHUB_ACTION=crazy-maxghaction-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_cc4da131-0660-4771-8663-0f96c0fc944f
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_REF=refs/heads/master
GITHUB_REPOSITORY=crazy-max/test-docker-action
GITHUB_REPOSITORY_OWNER=crazy-max
GITHUB_RETENTION_DAYS=90
GITHUB_RUN_ID=867725119
GITHUB_RUN_NUMBER=12
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=f24900bfcfee76d8055c8421a164c7e57ad20e68
GITHUB_WORKFLOW=push-ghcr
GITHUB_WORKSPACE=/home/runner/work/test-docker-action/test-docker-action

View File

@@ -0,0 +1,476 @@
{
"action": "synchronize",
"after": "57a8fb29acfb3c1e27c66226a8993fb4ef722e26",
"before": "18c4c149d695bdeba42643ef8343a6b8e466970c",
"number": 8,
"pull_request": {
"_links": {
"comments": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8/comments"
},
"commits": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/commits"
},
"html": {
"href": "https://github.com/crazy-max/test-docker-action/pull/8"
},
"issue": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/issues/8"
},
"review_comment": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/comments{/number}"
},
"review_comments": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8/comments"
},
"self": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/pulls/8"
},
"statuses": {
"href": "https://api.github.com/repos/crazy-max/test-docker-action/statuses/57a8fb29acfb3c1e27c66226a8993fb4ef722e26"
}
},
"active_lock_reason": null,
"additions": 1,
"assignee": null,
"assignees": [],
"author_association": "OWNER",
"auto_merge": null,
"base": {
"label": "crazy-max:master",
"ref": "master",
"repo": {
"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}",
"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": "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",
"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": 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",
"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,
"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",
"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/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,
"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}",
"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"
},
"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
},
"sha": "2b13c4617af78dc00a6304390682f234a53f3665",
"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"
}
},
"body": "",
"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",
"deletions": 1,
"diff_url": "https://github.com/crazy-max/test-docker-action/pull/8.diff",
"draft": false,
"head": {
"label": "crazy-max:test-pr-target",
"ref": "test-pr-target",
"repo": {
"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}",
"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": "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",
"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": 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",
"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,
"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",
"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/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,
"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}",
"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"
},
"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
},
"sha": "57a8fb29acfb3c1e27c66226a8993fb4ef722e26",
"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"
}
},
"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",
"labels": [],
"locked": false,
"maintainer_can_modify": false,
"merge_commit_sha": "823b99c3c3cf5421e6ff0514b13a44bf21c7a4f0",
"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",
"rebaseable": null,
"requested_reviewers": [],
"requested_teams": [],
"review_comment_url": "https://api.github.com/repos/crazy-max/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",
"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",
"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"
}
},
"repository": {
"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": "2020-08-07T09:23:00Z",
"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": 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",
"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,
"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",
"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/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,
"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}",
"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"
},
"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
},
"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"
}
}

View File

@@ -1,10 +1,9 @@
import * as path from 'path'; import * as path from 'path';
import * as github from '../src/github'; import * as github from '../src/github';
import {ReposGetResponseData} from '@octokit/types';
jest.spyOn(github, 'repo').mockImplementation( jest.spyOn(github, 'repo').mockImplementation(
(): Promise<ReposGetResponseData> => { (): Promise<github.ReposGetResponseData> => {
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json')); return <Promise<github.ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
} }
); );

View File

@@ -6,11 +6,10 @@ import {getInputs, Inputs} from '../src/context';
import * as github from '../src/github'; import * as github from '../src/github';
import {Meta, Version} from '../src/meta'; import {Meta, Version} from '../src/meta';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
jest.spyOn(github, 'repo').mockImplementation( jest.spyOn(github, 'repo').mockImplementation(
(): Promise<ReposGetResponseData> => { (): Promise<github.ReposGetResponseData> => {
return <Promise<ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json')); return <Promise<github.ReposGetResponseData>>require(path.join(__dirname, 'fixtures', 'repo.json'));
} }
); );
@@ -617,6 +616,38 @@ describe('push', () => {
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071", "org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT" "org.opencontainers.image.licenses=MIT"
] ]
],
[
'push18',
'event_push.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=ref,event=branch`,
`type=sha,format=long`
],
} as Inputs,
{
main: 'dev',
partial: ['sha-90dd6032fac8bda1b6c4436a2e65de27961ed071'],
latest: false
} as Version,
[
'org/app:dev',
'org/app:sha-90dd6032fac8bda1b6c4436a2e65de27961ed071',
'ghcr.io/user/app:dev',
'ghcr.io/user/app:sha-90dd6032fac8bda1b6c4436a2e65de27961ed071'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=dev",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
] ]
])('given %p with %p event', tagsLabelsTest); ])('given %p with %p event', tagsLabelsTest);
}); });
@@ -1744,6 +1775,108 @@ describe('pr', () => {
"org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504", "org.opencontainers.image.revision=1e9249f05bfc090e0688b8fb9c1b347586add504",
"org.opencontainers.image.licenses=MIT" "org.opencontainers.image.licenses=MIT"
] ]
],
[
'pr07',
'event_pull_request_target.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=sha,priority=2000`,
`type=ref,event=pr`
]
} as Inputs,
{
main: 'sha-f24900b',
partial: ['pr-8'],
latest: false
} as Version,
[
'org/app:sha-f24900b',
'org/app:pr-8',
'ghcr.io/user/app:sha-f24900b',
'ghcr.io/user/app:pr-8'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=sha-f24900b",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=f24900bfcfee76d8055c8421a164c7e57ad20e68",
"org.opencontainers.image.licenses=MIT"
]
],
[
'pr08',
'event_pull_request_target.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=ref,event=pr,prefix=`
],
flavor: [
`prefix=glo-`,
`suffix=-bal`
]
} as Inputs,
{
main: '8-bal',
partial: [],
latest: false
} as Version,
[
'org/app:8-bal',
'ghcr.io/user/app:8-bal'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=8-bal",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=f24900bfcfee76d8055c8421a164c7e57ad20e68",
"org.opencontainers.image.licenses=MIT"
]
],
[
'pr09',
'event_pull_request_target.env',
{
images: ['org/app'],
tags: [
`type=ref,event=tag`,
`type=ref,event=pr`,
`type=ref,event=branch`,
`type=sha`,
`type=sha,format=long`
]
} as Inputs,
{
main: 'pr-8',
partial: [
'sha-f24900b',
'sha-f24900bfcfee76d8055c8421a164c7e57ad20e68'
],
latest: false
} as Version,
[
'org/app:pr-8',
'org/app:sha-f24900b',
'org/app:sha-f24900bfcfee76d8055c8421a164c7e57ad20e68'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=pr-8",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=f24900bfcfee76d8055c8421a164c7e57ad20e68",
"org.opencontainers.image.licenses=MIT"
]
] ]
])('given %p with %p event', tagsLabelsTest); ])('given %p with %p event', tagsLabelsTest);
}); });
@@ -2362,6 +2495,258 @@ describe('raw', () => {
])('given %p wth %p event', tagsLabelsTest); ])('given %p wth %p event', tagsLabelsTest);
}); });
describe('json', () => {
// prettier-ignore
test.each([
[
'json01',
'event_push.env',
{
images: ['user/app'],
tags: [
`type=ref,event=branch`,
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
],
labels: [
"invalid"
]
} as Inputs,
{
"tags": [
"user/app:dev",
"user/app:my",
"user/app:custom",
"user/app:tags"
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "dev",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json02',
'event_push.env',
{
images: ['user/app'],
tags: [
`type=ref,event=branch`,
`type=raw,my`
]
} as Inputs,
{
"tags": [
"user/app:dev",
"user/app:my",
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "dev",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json03',
'event_tag_release1.env',
{
images: ['user/app'],
tags: [
`type=ref,event=tag`,
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
],
bakeTarget: "meta"
} as Inputs,
{
"tags": [
"user/app:release1",
"user/app:my",
"user/app:custom",
"user/app:tags",
"user/app:latest"
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "release1",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json04',
'event_tag_20200110-RC2.env',
{
images: ['user/app'],
tags: [
`type=match,pattern=\\d{8}`,
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
],
flavor: [
`latest=false`
]
} as Inputs,
{
"tags": [
"user/app:20200110",
"user/app:my",
"user/app:custom",
"user/app:tags"
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "20200110",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json05',
'event_tag_v1.1.1.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=semver,pattern={{version}}`,
`type=semver,pattern={{major}}.{{minor}}`,
`type=semver,pattern={{major}}`,
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
]
} as Inputs,
{
"tags": [
"org/app:1.1.1",
"org/app:1.1",
"org/app:1",
"org/app:my",
"org/app:custom",
"org/app:tags",
"org/app:latest",
"ghcr.io/user/app:1.1.1",
"ghcr.io/user/app:1.1",
"ghcr.io/user/app:1",
"ghcr.io/user/app:my",
"ghcr.io/user/app:custom",
"ghcr.io/user/app:tags",
"ghcr.io/user/app:latest"
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "1.1.1",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json06',
'event_tag_v1.1.1.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tags: [
`type=raw,my`,
`type=raw,custom`,
`type=raw,tags`
]
} as Inputs,
{
"tags": [
"org/app:my",
"org/app:custom",
"org/app:tags",
"ghcr.io/user/app:my",
"ghcr.io/user/app:custom",
"ghcr.io/user/app:tags"
],
"labels": {
"org.opencontainers.image.title": "Hello-World",
"org.opencontainers.image.description": "This your first repo!",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.version": "my",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
],
[
'json07',
'event_tag_v1.1.1.env',
{
images: ['org/app'],
labels: [
"foo",
"maintainer=CrazyMax",
"org.opencontainers.image.title=MyCustom=Title",
"org.opencontainers.image.description=Another description",
"org.opencontainers.image.vendor=MyCompany",
],
} as Inputs,
{
"tags": [
"org/app:v1.1.1",
"org/app:latest"
],
"labels": {
"maintainer": "CrazyMax",
"org.opencontainers.image.title": "MyCustom=Title",
"org.opencontainers.image.description": "Another description",
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
"org.opencontainers.image.vendor": "MyCompany",
"org.opencontainers.image.version": "v1.1.1",
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision": "90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses": "MIT"
}
}
]
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exJSON: {}) => {
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
const context = github.context();
console.log(process.env, context);
const repo = await github.repo(process.env.GITHUB_TOKEN || '');
const meta = new Meta({...getInputs(), ...inputs}, context, repo);
const jsonOutput = meta.getJSON();
console.log('json', jsonOutput);
expect(jsonOutput).toEqual(exJSON);
});
});
describe('bake', () => { describe('bake', () => {
// prettier-ignore // prettier-ignore
test.each([ test.each([
@@ -2382,7 +2767,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"user/app:dev", "user/app:dev",
"user/app:my", "user/app:my",
@@ -2419,7 +2804,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"user/app:dev", "user/app:dev",
"user/app:my", "user/app:my",
@@ -2500,7 +2885,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"user/app:20200110", "user/app:20200110",
"user/app:my", "user/app:my",
@@ -2541,7 +2926,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"org/app:1.1.1", "org/app:1.1.1",
"org/app:1.1", "org/app:1.1",
@@ -2589,7 +2974,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"org/app:my", "org/app:my",
"org/app:custom", "org/app:custom",
@@ -2630,7 +3015,7 @@ describe('bake', () => {
} as Inputs, } as Inputs,
{ {
"target": { "target": {
"ghaction-docker-meta": { "docker-metadata-action": {
"tags": [ "tags": [
"org/app:v1.1.1", "org/app:v1.1.1",
"org/app:latest" "org/app:latest"

View File

@@ -1,4 +1,4 @@
import {Transform, Parse, Tag, Type, RefEvent, DefaultPriorities} from '../src/tag'; import {Transform, Parse, Tag, Type, RefEvent, ShaFormat, DefaultPriorities} from '../src/tag';
describe('transform', () => { describe('transform', () => {
// prettier-ignore // prettier-ignore
@@ -89,7 +89,8 @@ describe('transform', () => {
attrs: { attrs: {
"priority": DefaultPriorities[Type.Sha], "priority": DefaultPriorities[Type.Sha],
"enable": "true", "enable": "true",
"prefix": "sha-" "prefix": "sha-",
"format": ShaFormat.Short
} }
} }
] as Tag[], ] as Tag[],
@@ -355,7 +356,21 @@ describe('parse', () => {
attrs: { attrs: {
"priority": DefaultPriorities[Type.Sha], "priority": DefaultPriorities[Type.Sha],
"enable": "true", "enable": "true",
"prefix": "sha-" "prefix": "sha-",
"format": ShaFormat.Short
}
} as Tag,
false
],
[
`type=sha,format=long`,
{
type: Type.Sha,
attrs: {
"priority": DefaultPriorities[Type.Sha],
"enable": "true",
"prefix": "sha-",
"format": ShaFormat.Long
} }
} as Tag, } as Tag,
false false
@@ -367,7 +382,8 @@ describe('parse', () => {
attrs: { attrs: {
"priority": DefaultPriorities[Type.Sha], "priority": DefaultPriorities[Type.Sha],
"enable": "true", "enable": "true",
"prefix": "" "prefix": "",
"format": ShaFormat.Short
} }
} as Tag, } as Tag,
false false
@@ -379,7 +395,8 @@ describe('parse', () => {
attrs: { attrs: {
"priority": DefaultPriorities[Type.Sha], "priority": DefaultPriorities[Type.Sha],
"enable": "false", "enable": "false",
"prefix": "sha-" "prefix": "sha-",
"format": ShaFormat.Short
} }
} as Tag, } as Tag,
false false
@@ -403,6 +420,11 @@ describe('parse', () => {
`type=sha,enable=foo`, `type=sha,enable=foo`,
{} as Tag, {} as Tag,
true true
],
[
`type=sha,format=foo`,
{} as Tag,
true
] ]
])('given %p event ', async (s: string, expected: Tag, invalid: boolean) => { ])('given %p event ', async (s: string, expected: Tag, invalid: boolean) => {
try { try {

View File

@@ -1,10 +1,10 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions # https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: 'Docker Meta' name: 'Docker Metadata action'
description: "GitHub Action to extract metadata (tags, labels) for Docker" description: "GitHub Action to extract metadata (tags, labels) for Docker"
author: 'crazy-max' author: 'docker'
branding: branding:
icon: 'anchor'
color: 'blue' color: 'blue'
icon: 'layers'
inputs: inputs:
images: images:
@@ -26,7 +26,7 @@ inputs:
description: 'Separator to use for labels output (default \n)' description: 'Separator to use for labels output (default \n)'
required: false required: false
bake-target: bake-target:
description: 'Bake target name (default ghaction-docker-meta)' description: 'Bake target name (default docker-metadata-action)'
required: false required: false
github-token: github-token:
description: 'GitHub Token as provided by secrets' description: 'GitHub Token as provided by secrets'

990
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{ {
"name": "docker-meta", "name": "docker-metadata-action",
"description": "GitHub Action to extract metadata (tags, labels) for Docker", "description": "GitHub Action to extract metadata (tags, labels) for Docker",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
@@ -11,20 +11,26 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/crazy-max/ghaction-docker-meta.git" "url": "git+https://github.com/docker/metadata-action.git"
}, },
"keywords": [ "keywords": [
"actions", "actions",
"docker", "docker",
"meta", "metadata",
"tag", "tag",
"label" "label"
], ],
"author": "CrazyMax", "author": "Docker",
"license": "MIT", "contributors": [
{
"name": "CrazyMax",
"url": "https://crazymax.dev"
}
],
"license": "Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.7", "@actions/core": "^1.3.0",
"@actions/github": "^4.0.0", "@actions/github": "^5.0.0",
"csv-parse": "^4.15.4", "csv-parse": "^4.15.4",
"handlebars": "^4.7.7", "handlebars": "^4.7.7",
"moment": "^2.29.1", "moment": "^2.29.1",

View File

@@ -20,7 +20,7 @@ export interface Inputs {
export function tmpDir(): string { export function tmpDir(): string {
if (!_tmpDir) { if (!_tmpDir) {
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ghaction-docker-meta-')).split(path.sep).join(path.posix.sep); _tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-metadata-action-')).split(path.sep).join(path.posix.sep);
} }
return _tmpDir; return _tmpDir;
} }
@@ -33,7 +33,7 @@ export function getInputs(): Inputs {
labels: getInputList('labels', true), labels: getInputList('labels', true),
sepTags: core.getInput('sep-tags') || `\n`, sepTags: core.getInput('sep-tags') || `\n`,
sepLabels: core.getInput('sep-labels') || `\n`, sepLabels: core.getInput('sep-labels') || `\n`,
bakeTarget: core.getInput('bake-target') || `ghaction-docker-meta`, bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
githubToken: core.getInput('github-token') githubToken: core.getInput('github-token')
}; };
} }

View File

@@ -1,18 +1,18 @@
import * as github from '@actions/github'; import * as github from '@actions/github';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types'; import {components as OctoOpenApiTypes} from '@octokit/openapi-types';
export type ReposGetResponseData = OctoOpenApiTypes['schemas']['repository'];
export function context(): Context { export function context(): Context {
return github.context; return github.context;
} }
export async function repo(token: string): Promise<ReposGetResponseData> { export async function repo(token: string): Promise<ReposGetResponseData> {
const octokit = github.getOctokit(token); return github
const repo = await octokit.repos.get({ .getOctokit(token)
.rest.repos.get({
...github.context.repo ...github.context.repo
}); })
if (!repo?.data) { .then(response => response.data as ReposGetResponseData);
throw new Error('Cannot get GitHub repository');
}
return repo.data;
} }

View File

@@ -4,7 +4,6 @@ import * as github from './github';
import {Meta, Version} from './meta'; import {Meta, Version} from './meta';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
async function run() { async function run() {
try { try {
@@ -14,7 +13,7 @@ async function run() {
} }
const context: Context = github.context(); const context: Context = github.context();
const repo: ReposGetResponseData = await github.repo(inputs.githubToken); const repo: github.ReposGetResponseData = await github.repo(inputs.githubToken);
core.startGroup(`Context info`); core.startGroup(`Context info`);
core.info(`eventName: ${context.eventName}`); core.info(`eventName: ${context.eventName}`);
core.info(`sha: ${context.sha}`); core.info(`sha: ${context.sha}`);
@@ -60,6 +59,13 @@ async function run() {
core.endGroup(); core.endGroup();
setOutput('labels', labels.join(inputs.sepLabels)); setOutput('labels', labels.join(inputs.sepLabels));
// JSON
const jsonOutput = meta.getJSON();
core.startGroup(`JSON output`);
core.info(JSON.stringify(jsonOutput, null, 2));
core.endGroup();
setOutput('json', jsonOutput);
// Bake definition file // Bake definition file
const bakeFile: string = meta.getBakeFile(); const bakeFile: string = meta.getBakeFile();
core.startGroup(`Bake definition file`); core.startGroup(`Bake definition file`);

View File

@@ -4,11 +4,11 @@ import * as path from 'path';
import moment from 'moment'; import moment from 'moment';
import * as semver from 'semver'; import * as semver from 'semver';
import {Inputs, tmpDir} from './context'; import {Inputs, tmpDir} from './context';
import {ReposGetResponseData} from './github';
import * as tcl from './tag'; import * as tcl from './tag';
import * as fcl from './flavor'; import * as fcl from './flavor';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Context} from '@actions/github/lib/context'; import {Context} from '@actions/github/lib/context';
import {ReposGetResponseData} from '@octokit/types';
export interface Version { export interface Version {
main: string | undefined; main: string | undefined;
@@ -27,6 +27,12 @@ export class Meta {
private readonly date: Date; private readonly date: Date;
constructor(inputs: Inputs, context: Context, repo: ReposGetResponseData) { 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`;
}
this.inputs = inputs; this.inputs = inputs;
this.context = context; this.context = context;
this.repo = repo; this.repo = repo;
@@ -194,6 +200,7 @@ export class Meta {
if (!/^refs\/pull\//.test(this.context.ref)) { if (!/^refs\/pull\//.test(this.context.ref)) {
return version; return version;
} }
const vraw = this.setValue(this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, ''), tag); const vraw = this.setValue(this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, ''), tag);
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true'); return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true');
} }
@@ -224,7 +231,13 @@ export class Meta {
if (!this.context.sha) { if (!this.context.sha) {
return version; return version;
} }
const vraw = this.setValue(this.context.sha.substr(0, 7), tag);
let val = this.context.sha;
if (tag.attrs['format'] === tcl.ShaFormat.Short) {
val = this.context.sha.substr(0, 7);
}
const vraw = this.setValue(val, tag);
return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true'); return Meta.setVersion(version, vraw, this.flavor.latest == 'auto' ? false : this.flavor.latest == 'true');
} }
@@ -312,17 +325,22 @@ export class Meta {
return labels; return labels;
} }
public getBakeFile(): string { public getJSON(): {} {
let jsonLabels = {}; return {
for (let label of this.getLabels()) { tags: this.getTags(),
labels: this.getLabels().reduce((res, label) => {
const matches = label.match(/([^=]*)=(.*)/); const matches = label.match(/([^=]*)=(.*)/);
if (!matches) { if (!matches) {
continue; return res;
} }
jsonLabels[matches[1]] = matches[2]; res[matches[1]] = matches[2];
return res;
}, {})
};
} }
const bakeFile = path.join(tmpDir(), 'ghaction-docker-meta-bake.json').split(path.sep).join(path.posix.sep); public getBakeFile(): string {
const bakeFile = path.join(tmpDir(), 'docker-metadata-action-bake.json').split(path.sep).join(path.posix.sep);
fs.writeFileSync( fs.writeFileSync(
bakeFile, bakeFile,
JSON.stringify( JSON.stringify(
@@ -330,7 +348,14 @@ export class Meta {
target: { target: {
[this.inputs.bakeTarget]: { [this.inputs.bakeTarget]: {
tags: this.getTags(), tags: this.getTags(),
labels: jsonLabels, labels: this.getLabels().reduce((res, label) => {
const matches = label.match(/([^=]*)=(.*)/);
if (!matches) {
return res;
}
res[matches[1]] = matches[2];
return res;
}, {}),
args: { args: {
DOCKER_META_IMAGES: this.inputs.images.join(','), DOCKER_META_IMAGES: this.inputs.images.join(','),
DOCKER_META_VERSION: this.version.main DOCKER_META_VERSION: this.version.main

View File

@@ -17,6 +17,11 @@ export enum RefEvent {
PR = 'pr' PR = 'pr'
} }
export enum ShaFormat {
Short = 'short',
Long = 'long'
}
export class Tag { export class Tag {
public type?: Type; public type?: Type;
public attrs: Record<string, string>; public attrs: Record<string, string>;
@@ -175,6 +180,16 @@ export function Parse(s: string): Tag {
if (!tag.attrs.hasOwnProperty('prefix')) { if (!tag.attrs.hasOwnProperty('prefix')) {
tag.attrs['prefix'] = 'sha-'; tag.attrs['prefix'] = 'sha-';
} }
if (!tag.attrs.hasOwnProperty('format')) {
tag.attrs['format'] = ShaFormat.Short;
}
if (
!Object.keys(ShaFormat)
.map(k => ShaFormat[k])
.includes(tag.attrs['format'])
) {
throw new Error(`Invalid format for ${s}`);
}
break; break;
} }
} }

View File

@@ -1,4 +1,4 @@
target "ghaction-docker-meta" {} target "docker-metadata-action" {}
group "default" { group "default" {
targets = ["db", "app"] targets = ["db", "app"]
@@ -14,7 +14,7 @@ target "db" {
} }
target "app" { target "app" {
inherits = ["ghaction-docker-meta"] inherits = ["docker-metadata-action"]
context = "./test" context = "./test"
dockerfile = "Dockerfile" dockerfile = "Dockerfile"
args = { args = {

138
yarn.lock
View File

@@ -2,25 +2,25 @@
# yarn lockfile v1 # yarn lockfile v1
"@actions/core@^1.2.7": "@actions/core@^1.3.0":
version "1.2.7" version "1.3.0"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.7.tgz#594f8c45b213f0146e4be7eda8ae5cf4e198e5ab" resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.3.0.tgz#f5e4b24c889e7f2e58b466cc8c7481292284eba0"
integrity sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig== integrity sha512-xxtX0Cwdhb8LcgatfJkokqT8KzPvcIbwL9xpLU09nOwBzaStbfm0dNncsP0M4us+EpoPdWy7vbzU5vSOH7K6pg==
"@actions/github@^4.0.0": "@actions/github@^5.0.0":
version "4.0.0" version "5.0.0"
resolved "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816" resolved "https://registry.yarnpkg.com/@actions/github/-/github-5.0.0.tgz#1754127976c50bd88b2e905f10d204d76d1472f8"
integrity sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA== integrity sha512-QvE9eAAfEsS+yOOk0cylLBIO/d6WyWIOvsxxzdrPFaud39G6BOkUwScXZn1iBzQzHyu9SBkkLSWlohDWdsasAQ==
dependencies: dependencies:
"@actions/http-client" "^1.0.8" "@actions/http-client" "^1.0.11"
"@octokit/core" "^3.0.0" "@octokit/core" "^3.4.0"
"@octokit/plugin-paginate-rest" "^2.2.3" "@octokit/plugin-paginate-rest" "^2.13.3"
"@octokit/plugin-rest-endpoint-methods" "^4.0.0" "@octokit/plugin-rest-endpoint-methods" "^5.1.1"
"@actions/http-client@^1.0.8": "@actions/http-client@^1.0.11":
version "1.0.9" version "1.0.11"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.9.tgz#af1947d020043dbc6a3b4c5918892095c30ffb52" resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.11.tgz#c58b12e9aa8b159ee39e7dd6cbd0e91d905633c0"
integrity sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg== integrity sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==
dependencies: dependencies:
tunnel "0.0.6" tunnel "0.0.6"
@@ -486,23 +486,24 @@
"@types/yargs" "^15.0.0" "@types/yargs" "^15.0.0"
chalk "^4.0.0" chalk "^4.0.0"
"@octokit/auth-token@^2.4.0": "@octokit/auth-token@^2.4.4":
version "2.4.2" version "2.4.5"
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.2.tgz#10d0ae979b100fa6b72fa0e8e63e27e6d0dbff8a" resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.5.tgz#568ccfb8cb46f36441fac094ce34f7a875b197f3"
integrity sha512-jE/lE/IKIz2v1+/P0u4fJqv0kYwXOTujKemJMFr6FeopsxlIK3+wKDCJGnysg81XID5TgZQbIfuJ5J0lnTiuyQ== integrity sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==
dependencies: dependencies:
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
"@octokit/core@^3.0.0": "@octokit/core@^3.4.0":
version "3.1.4" version "3.4.0"
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.1.4.tgz#9c51a3d77bad7d8aa5ec0e997ee90da224206b5e" resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.4.0.tgz#b48aa27d755b339fe7550548b340dcc2b513b742"
integrity sha512-eNDwFpKbGbLzPXiFE5PCoeq3nHlKTmWcCtZfQNCwJmW21XqrWr6c2uUhgLCzDeDkQVvKqUWaIgeCDB6i6mvFoA== integrity sha512-6/vlKPP8NF17cgYXqucdshWqmMZGXkuvtcrWCgU5NOI0Pl2GjlmZyWgBMrU8zJ3v2MJlM6++CiB45VKYmhiWWg==
dependencies: dependencies:
"@octokit/auth-token" "^2.4.0" "@octokit/auth-token" "^2.4.4"
"@octokit/graphql" "^4.3.1" "@octokit/graphql" "^4.5.8"
"@octokit/request" "^5.4.0" "@octokit/request" "^5.4.12"
"@octokit/types" "^5.0.0" "@octokit/request-error" "^2.0.5"
before-after-hook "^2.1.0" "@octokit/types" "^6.0.3"
before-after-hook "^2.2.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/endpoint@^6.0.1": "@octokit/endpoint@^6.0.1":
@@ -514,28 +515,33 @@
is-plain-object "^5.0.0" is-plain-object "^5.0.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/graphql@^4.3.1": "@octokit/graphql@^4.5.8":
version "4.5.6" version "4.6.2"
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.5.6.tgz#708143ba15cf7c1879ed6188266e7f270be805d4" resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.6.2.tgz#ec44abdfa87f2b9233282136ae33e4ba446a04e7"
integrity sha512-Rry+unqKTa3svswT2ZAuqenpLrzJd+JTv89LTeVa5UM/5OX8o4KTkPL7/1ABq4f/ZkELb0XEK/2IEoYwykcLXg== integrity sha512-WmsIR1OzOr/3IqfG9JIczI8gMJUMzzyx5j0XXQ4YihHtKlQc+u35VpVoOXhlKAlaBntvry1WpAzPl/a+s3n89Q==
dependencies: dependencies:
"@octokit/request" "^5.3.0" "@octokit/request" "^5.3.0"
"@octokit/types" "^5.0.0" "@octokit/types" "^6.0.3"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/plugin-paginate-rest@^2.2.3": "@octokit/openapi-types@^7.2.0":
version "2.4.0" version "7.2.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.4.0.tgz#92f951ddc8a1cd505353fa07650752ca25ed7e93" resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.2.1.tgz#3ba1abe8906863edd403e185bc12e2bf79b3e240"
integrity sha512-YT6Klz3LLH6/nNgi0pheJnUmTFW4kVnxGft+v8Itc41IIcjl7y1C8TatmKQBbCSuTSNFXO5pCENnqg6sjwpJhg== integrity sha512-IHQJpLciwzwDvciLxiFj3IEV5VYn7lSVcj5cu0jbTwMfK4IG6/g8SPrVp3Le1VRzIiYSRcBzm1dA7vgWelYP3Q==
dependencies:
"@octokit/types" "^5.5.0"
"@octokit/plugin-rest-endpoint-methods@^4.0.0": "@octokit/plugin-paginate-rest@^2.13.3":
version "4.2.0" version "2.13.3"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.0.tgz#c5a0691b3aba5d8b4ef5dffd6af3649608f167ba" resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.3.tgz#f0f1792230805108762d87906fb02d573b9e070a"
integrity sha512-1/qn1q1C1hGz6W/iEDm9DoyNoG/xdFDt78E3eZ5hHeUfJTLJgyAMdj9chL/cNBHjcjd+FH5aO1x0VCqR2RE0mw== integrity sha512-46lptzM9lTeSmIBt/sVP/FLSTPGx6DCzAdSX3PfeJ3mTf4h9sGC26WpaQzMEq/Z44cOcmx8VsOhO+uEgE3cjYg==
dependencies: dependencies:
"@octokit/types" "^5.5.0" "@octokit/types" "^6.11.0"
"@octokit/plugin-rest-endpoint-methods@^5.1.1":
version "5.3.0"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.3.0.tgz#bcc8b4432ee24b30d6a4934c9e2baacda46a5aaf"
integrity sha512-+4NAJ9WzPN5gW6W1H1tblw/DesTD6PaWuU5+/x3Pa7nyK6qjR6cn4jwkJtzxVPTgtzryOFLX+5vs7MROFswp5Q==
dependencies:
"@octokit/types" "^6.16.0"
deprecation "^2.3.1" deprecation "^2.3.1"
"@octokit/request-error@^2.0.0": "@octokit/request-error@^2.0.0":
@@ -547,7 +553,16 @@
deprecation "^2.0.0" deprecation "^2.0.0"
once "^1.4.0" once "^1.4.0"
"@octokit/request@^5.3.0", "@octokit/request@^5.4.0": "@octokit/request-error@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.5.tgz#72cc91edc870281ad583a42619256b380c600143"
integrity sha512-T/2wcCFyM7SkXzNoyVNWjyVlUwBvW3igM3Btr/eKYiPmucXTtkxt2RBsf6gn3LTzaLSLTQtNmvg+dGsOxQrjZg==
dependencies:
"@octokit/types" "^6.0.3"
deprecation "^2.0.0"
once "^1.4.0"
"@octokit/request@^5.3.0":
version "5.4.9" version "5.4.9"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.9.tgz#0a46f11b82351b3416d3157261ad9b1558c43365" resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.9.tgz#0a46f11b82351b3416d3157261ad9b1558c43365"
integrity sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA== integrity sha512-CzwVvRyimIM1h2n9pLVYfTDmX9m+KHSgCpqPsY8F1NdEK8IaWqXhSBXsdjOBFZSpEcxNEeg4p0UO9cQ8EnOCLA==
@@ -561,13 +576,32 @@
once "^1.4.0" once "^1.4.0"
universal-user-agent "^6.0.0" universal-user-agent "^6.0.0"
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.5.0": "@octokit/request@^5.4.12":
version "5.4.15"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.15.tgz#829da413dc7dd3aa5e2cdbb1c7d0ebe1f146a128"
integrity sha512-6UnZfZzLwNhdLRreOtTkT9n57ZwulCve8q3IT/Z477vThu6snfdkBuhxnChpOKNGxcQ71ow561Qoa6uqLdPtag==
dependencies:
"@octokit/endpoint" "^6.0.1"
"@octokit/request-error" "^2.0.0"
"@octokit/types" "^6.7.1"
is-plain-object "^5.0.0"
node-fetch "^2.6.1"
universal-user-agent "^6.0.0"
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1":
version "5.5.0" version "5.5.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b" resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.5.0.tgz#e5f06e8db21246ca102aa28444cdb13ae17a139b"
integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ== integrity sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==
dependencies: dependencies:
"@types/node" ">= 8" "@types/node" ">= 8"
"@octokit/types@^6.0.3", "@octokit/types@^6.11.0", "@octokit/types@^6.16.0", "@octokit/types@^6.7.1":
version "6.16.0"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.16.0.tgz#15f71e391ca74e91a21b70e3a1b033c89625dca4"
integrity sha512-EktqSNq8EKXE82a7Vw33ozOEhFXIRik+rZHJTHAgVZRm/p2K5r5ecn5fVpRkLCm3CAVFwchRvt3yvtmfbt2LCQ==
dependencies:
"@octokit/openapi-types" "^7.2.0"
"@sinonjs/commons@^1.7.0": "@sinonjs/commons@^1.7.0":
version "1.8.1" version "1.8.1"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.1.tgz#e7df00f98a203324f6dc7cc606cad9d4a8ab2217"
@@ -910,10 +944,10 @@ bcrypt-pbkdf@^1.0.0:
dependencies: dependencies:
tweetnacl "^0.14.3" tweetnacl "^0.14.3"
before-after-hook@^2.1.0: before-after-hook@^2.2.0:
version "2.1.0" version "2.2.1"
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.1.tgz#73540563558687586b52ed217dad6a802ab1549c"
integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== integrity sha512-/6FKxSTWoJdbsLDF8tdIjaRiFXiE6UHsEHE3OPI/cwPURCVi1ukP0gmLn7XWEiFk5TcwQjjY5PWsU+j+tgXgmw==
brace-expansion@^1.1.7: brace-expansion@^1.1.7:
version "1.1.11" version "1.1.11"