From cc21f018761257f16738da3c85435dc639e4ed4e Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 16 Sep 2020 03:30:16 +0900 Subject: [PATCH 1/2] Improve example for OCI Image Spec annotations Fill in title, description and url labels based on the repository information. Use repository clone URL from `github.event` instead of an undocumented variable. Fix licenses label to follow SPDX License Expressions. Signed-off-by: itchyny --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9180b4c..74ee3ef 100644 --- a/README.md +++ b/README.md @@ -395,11 +395,14 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.prep.outputs.tags }} labels: | - org.opencontainers.image.created=${{ steps.prep.outputs.created }} - org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.title=${{ github.event.repository.name }} + org.opencontainers.image.description=${{ github.event.repository.description }} + org.opencontainers.image.url=${{ github.event.repository.html_url }} + org.opencontainers.image.source=${{ github.event.repository.clone_url }} org.opencontainers.image.version=${{ steps.prep.outputs.version }} + org.opencontainers.image.created=${{ steps.prep.outputs.created }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.licenses=${{ github.event.repository.license.name }} + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} ``` ### Update DockerHub repo description From d60f17430519e3a897f6479152ea9f23a6ac2686 Mon Sep 17 00:00:00 2001 From: itchyny Date: Wed, 16 Sep 2020 03:36:39 +0900 Subject: [PATCH 2/2] Update example action for labels Signed-off-by: itchyny --- .github/workflows/example.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 1f05215..e784639 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -68,10 +68,11 @@ jobs: tags: ${{ steps.prep.outputs.tags }} labels: | org.opencontainers.image.created=${{ steps.prep.outputs.created }} - org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.url=${{ github.event.repository.html_url }} + org.opencontainers.image.source=${{ github.event.repository.clone_url }} org.opencontainers.image.version=${{ steps.prep.outputs.version }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.licenses=${{ github.event.repository.license.name }} + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} - name: Build and push to local registry uses: ./ @@ -82,10 +83,11 @@ jobs: tags: ${{ steps.prep.outputs.tags }} labels: | org.opencontainers.image.created=${{ steps.prep.outputs.created }} - org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.url=${{ github.event.repository.html_url }} + org.opencontainers.image.source=${{ github.event.repository.clone_url }} org.opencontainers.image.version=${{ steps.prep.outputs.version }} org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.licenses=${{ github.event.repository.license.name }} + org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} - name: Inspect image run: |