# How to access GitHub tag value in a job?

**URL:** <https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286>\
**Category:** Build Environment\
**Created:** [December 21, 2018, 12:24pm UTC](https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286 "2018-12-21T12:24:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrishowejones](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/chrishowejones/32/2074_2.png) [@chrishowejones](https://discuss.circleci.com/u/chrishowejones)\
**Post date:** [December 21, 2018, 12:24pm UTC](https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286/1 "2018-12-21T12:24:34Z")

</div>

Hi,  
I’m trying to follow the steps here: [https://circleci.com/blog/publishing-to-github-releases-via-circleci/#ci-builds-circleci-20-example](https://circleci.com/blog/publishing-to-github-releases-via-circleci/#ci-builds-circleci-20-example) to publish an artifact to github releases. However, this example get the $VERSION from the binary and I can’t do that. I want to set the version to be whatever the tag is from github. Is there a way to access the tag from Github that triggers the `publish-github-release` job?

---

<div class="post-metadata">

**Author:** ![levlaz](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/levlaz/32/36978_2.png) [@levlaz](https://discuss.circleci.com/u/levlaz)\
**Post date:** [December 23, 2018, 10:04pm UTC](https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286/2 "2018-12-23T22:04:18Z")

</div>

Builds that are a part of a tag expose the `CIRCLE_TAG` environment variable. You can use this to get the version of the tag.

You can see this in practice here: [https://github.com/levlaz/circleci.py/blob/master/setup.py#L22](https://github.com/levlaz/circleci.py/blob/master/setup.py#L22)

This function will compare the tag version in circle with the “version” of the package. In my case they need to match in order to proceed.

---

<div class="post-metadata">

**Author:** ![chrishowejones](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/chrishowejones/32/2074_2.png) [@chrishowejones](https://discuss.circleci.com/u/chrishowejones)\
**Post date:** [December 29, 2018, 1:36pm UTC](https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286/3 "2018-12-29T13:36:44Z")

</div>

Thanks @levlaz. That worked.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [January 8, 2019, 1:36pm UTC](https://discuss.circleci.com/t/how-to-access-github-tag-value-in-a-job/27286/4 "2019-01-08T13:36:45Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
