This is a lightweight GitHub Action that leverages the GitHub API to determine if a tag exists or not. This can be used to optimize your pipelines with basic validation before initiating long running processes that might fail much later in your pipeline. It can be configured to fail your pipeline on condition that your tag does or does not exists.
This action is intended to be added to an existing pipeline in your .github/workflows
directory. Refer to GitHub's official documentation or the example workflows in this repository for more information
†ag
: Required. The tag to lookup.owner
: Optional. Uses the current owner by default, or you can override to look at a different owner.repository
: Optional. Uses the current repository by default, or you can override to look at a different repository.github_token
: Optional. Uses ${{ github.token }} by default, or you can override if you need to provide a token that has access to a different repository. Refer to GitHub's GITHUB_TOKEN documentation for more information.fail_if_exists
: Optional boolean (defaults tofalse
). Set this totrue
so that your pipeline will fail if a matching tag is found. This is helpful for preventing build pipelines where the artifact already exists. Cannot be set totrue
iffail_if_not_exists
is also set totrue
.fail_if_not_exists
: Optional boolean (defaults tofalse
). Set this totrue
so that your pipeline will fail if a matching tag is not found. This is helpful for preventing deployment pipelines where the artifact does not exist. Cannot be set totrue
iffail_if_exists
is also set totrue
.
tag_exists
: Indicates if the tag exists or not. This can be used for conditional logic later in your pipeline.