Query for a single tag #1499
-
Hello everyone, is it possible to query for the existence of a single tag, with or without an associated release? So far I've seen methods to list all tags (which may be expensive in repos with too many tags, also don't need all the data per tag), and a method to find a release by tag (there might not be a release yet associated with said tag). At the moment I'm using the option to list all tags then iterate til I find the tag or not. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@aalmiray
|
Beta Was this translation helpful? Give feedback.
@aalmiray
You can query for the existence of a
ref
.github-api/src/main/java/org/kohsuke/github/GHRepository.java
Line 1884 in cf27f0c
repository.getRef("tags/" + tagName)
. This removes the need to iterate.