I am trying to write a script to automatically setup github releases using a custom CI trigger. I have a python script that uses pygithub
to automatically create a tag and a release.
# roughly the following code:
repo.create_git_tag(...)
repo.create_git_ref(...)
repo.create_git_release(...)
After running the script, everything shows up in the GitHub web UI, after a git fetch origin && git tag -l
, I can see the tags locally. But when I use git describe
(even with --tags
), it fails with fatal: No tags can describe '<head_commit_hash>'
Using git show-ref --tags
, I get something like the following:
hash1 refs/tags/releases/1.0.0
hash2 refs/tags/releases/1.1.0
hash3 refs/tags/releases/1.1.1
Then git cat-file -p hash1
gives me:
object hash_of_commit_at_tag
type commit
tag releases/1.0.0
tagger ...
Release: 1.0.0
But if I create and push the tag myself using git tag -a releases/1.0.0 hash_of_commit -m "Release 1.0.0"
, the git describe
gives me the last reachable tag from my current HEAD
.
Question is, is GitHub api
or pygithub
doing anything special? Or am I missing an api call in pygithub
?