Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
play

GitHub Action

docker-image-tag-exists

v1.0.0

docker-image-tag-exists

play

docker-image-tag-exists

Check if a given container image tag exists in a registry

Installation

Copy and paste the following snippet into your .yml file.

              

- name: docker-image-tag-exists

uses: tyriis/[email protected]

Learn more about this action in tyriis/docker-image-tag-exists

Choose a version

pre-commit taskfile

Docker Image Tag Exists

This action query a docker container registry to check if a given tag exists.

Table of Contents

User Story

As a user I want to know if a docker image tag already exists in a registry, this is required to prevent same commit to be build more then once (f.e. re-tagging an existing image after a release workflow).

The Idea

In order to be able to determine if the container image already exists we can try to get the manifest data from the registry. If the manifest exists the image + tag exists otherwise the request will fail and the image tag is not found.

What's new

First implementation is currently tested, use at own risk

  • tested docker.io Registry
  • tested ghcr.io Registry
  • tested Google Artifact Registry
  • tested Amazon Elastic Container Registry

Limitations

The return message of the registry is not standarized, please open a PR or create an issue if you encounter trouble with your registry.

Usage

- uses: tyriis/[email protected]
  with:
    # The container image name
    image: ''

    # The container image tag
    tag: ''

Outputs

name type description
tag string found or not found

License

The scripts and documentation in this project are released under the MIT License