From 720bee63549fdf694550fecead38a6011ffcf64d Mon Sep 17 00:00:00 2001 From: Nick Adcock Date: Fri, 6 Mar 2020 13:51:14 +0000 Subject: [PATCH 1/3] add_git_labels adds opencontainers labels Setting the INPUT_ADD_GIT_LABELS env var to true adds labels as per the opencontainers standard: https://github.com/opencontainers/image-spec/blob/master/annotations.md The 3 labels supported are: - org.opencontainers.image.created - org.opencontainers.image.source - org.opencontainers.image.revision Signed-off-by: Nick Adcock --- README.md | 7 ++++--- action.yml | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 67641fc..5a88203 100644 --- a/README.md +++ b/README.md @@ -124,14 +124,15 @@ labels: label_name_1=label_value_1,label_name_2=label_value_2 Boolean value. Defaults to `false`. -Adds labels with git repository information to the built image. +Adds labels with git repository information to the built image based on the standards set out in https://github.com/opencontainers/image-spec/blob/master/annotations.md. The labels are: |Label key|Example value|Description| |---|---|---| -|`com.docker.github-actions-actor`|`my-username`|The actor that kicked off the workflow. For example this could be the username of the user that did the git push.| -|`com.docker.github-actions-sha`|`676cae2f85471aeff6776463c72881ebd902dcf9`|Full git SHA of the current commit.| +|`org.opencontainers.image.created`|`2020-03-06T23:00:00Z`|Date and time on which the image was built (string, date-time as defined by RFC 3339).| +|`org.opencontainers.image.source`|`https://github.com/myorg/myrepository`|URL to this repository.| +|`org.opencontainers.image.revision`|`676cae2f85471aeff6776463c72881ebd902dcf9`|The full git sha of this commit.| ### `push` diff --git a/action.yml b/action.yml index 45eb5e9..16e51c2 100644 --- a/action.yml +++ b/action.yml @@ -3,7 +3,7 @@ description: Builds and pushes Docker images and will log in to a Docker registr author: Docker runs: using: docker - image: docker://docker/github-actions:v0.0.1 + image: docker://docker/github-actions:v0.1 args: - build-push inputs: @@ -51,7 +51,7 @@ inputs: description: Comma-delimited list of labels to add to the built image required: false add_git_labels: - description: Adds labels with git repo info to the built image + description: Adds labels with git repository information to the built image required: false default: false push: From 34907f062423384c7531fa7d07eced5e5655b2be Mon Sep 17 00:00:00 2001 From: Nick Adcock Date: Fri, 6 Mar 2020 13:55:12 +0000 Subject: [PATCH 2/3] Fix spelling of delimited Signed-off-by: Nick Adcock --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5a88203..3638184 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Always attempt to pull a newer version of the image. ### `build_args` -Comma-delmited list of build-time variables. +Comma-delimited list of build-time variables. Example: diff --git a/action.yml b/action.yml index 16e51c2..f9ccdf8 100644 --- a/action.yml +++ b/action.yml @@ -45,7 +45,7 @@ inputs: required: false default: false build_args: - description: Comma-delmited list of build-time variables + description: Comma-delimited list of build-time variables required: false labels: description: Comma-delimited list of labels to add to the built image From 1ccd3cd25b7bfc25f1e414cdc327a0a058e2bfbe Mon Sep 17 00:00:00 2001 From: Nick Adcock Date: Fri, 6 Mar 2020 15:01:36 +0000 Subject: [PATCH 3/3] Minor corrections to readme and yml Signed-off-by: Nick Adcock --- README.md | 6 +++--- action.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3638184..ce6a9da 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Username used to log in to a Docker registry. If not set then no login will occu ### `password` -Password used to log in to a Docker registry. If not set then no login will occur. +Password or personal access token used to log in to a Docker registry. If not set then no login will occur. ### `registry` @@ -131,8 +131,8 @@ The labels are: |Label key|Example value|Description| |---|---|---| |`org.opencontainers.image.created`|`2020-03-06T23:00:00Z`|Date and time on which the image was built (string, date-time as defined by RFC 3339).| -|`org.opencontainers.image.source`|`https://github.com/myorg/myrepository`|URL to this repository.| -|`org.opencontainers.image.revision`|`676cae2f85471aeff6776463c72881ebd902dcf9`|The full git sha of this commit.| +|`org.opencontainers.image.source`|`https://github.com/myorg/myrepository`|URL to the GitHub repository.| +|`org.opencontainers.image.revision`|`676cae2f85471aeff6776463c72881ebd902dcf9`|The full git SHA of this commit.| ### `push` diff --git a/action.yml b/action.yml index f9ccdf8..2ab3af6 100644 --- a/action.yml +++ b/action.yml @@ -11,7 +11,7 @@ inputs: description: Username used to log in to a Docker registry. If not set then no login will occur required: false password: - description: Password used to log in to a Docker registry. If not set then no login will occur + description: Password or personal access token used to log in to a Docker registry. If not set then no login will occur required: false registry: description: Server address of Docker registry. If not set then will default to Docker Hub @@ -27,7 +27,7 @@ inputs: required: false default: false tag_with_sha: - description: Automatically tags the built image with the git short sha as per the readme + description: Automatically tags the built image with the git short SHA as per the readme required: false default: false path: