# Expose GitHub Pull Request link in environment variable

**URL:** <https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609>\
**Category:** Released\
**Created:** [March 26, 2018, 5:45pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609 "2018-03-26T17:45:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bootstraponline](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bootstraponline](https://discuss.bitrise.io/u/bootstraponline)\
**Post date:** [March 26, 2018, 5:45pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/1 "2018-03-26T17:45:04Z")

</div>

## Description of the feature request

It’d be nice to easily link to pull requests on Slack messages. Currently the environment variables provided by bitrise aren’t sufficient for this use case.

## Use case / for what or how I would use it

$BITRISE\_GITHUB\_PULL\_REQUEST would contain the full path to the pull request. I’d use it in a Slack message step.

Example: [Add defaults for the configuration options to the README by doodla · Pull Request #152 · Flank/flank · GitHub](https://github.com/TestArmada/flank/pull/152)

Here’s our current work around:

```auto
- slack:
        is_always_run: true
        run_if: ".IsBuildFailed"
        inputs:
        - webhook_url: https://hooks.slack.com/<removed>
        - buttons: |
            View Build|${BITRISE_BUILD_URL}
            GitHub PR|https://github.com/instructure/instructure-android/pull/${BITRISE_PULL_REQUEST}

```

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 27, 2018, 5:28pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/2 "2018-03-27T17:28:41Z")

</div>

Good idea, just wondering how this should be done, as the PR URL is service dependent, it’s different on github, bitbucket, gitlab, …

Maybe this should be done via a step, using the repo URL & the PR ID? 🤔

---

<div class="post-metadata">

**Author:** ![bootstraponline](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bootstraponline](https://discuss.bitrise.io/u/bootstraponline)\
**Post date:** [March 28, 2018, 2:19am UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/3 "2018-03-28T02:19:31Z")

</div>

Maybe one ENV var per service?

GITHUB\_PR  
GITLAB\_PR  
etc.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 29, 2018, 2:31pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/4 "2018-03-29T14:31:46Z")

</div>

Sure, that can work, although Steps would be easier to change/update or even extend for other services 🤔

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 29, 2018, 2:32pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/5 "2018-03-29T14:32:54Z")

</div>

If we’d go with env vars, then I’d probably vote for NON service branded env var, e.g. `PULL_REQUEST_URL` or similar, as the purpose of this env var is expected to be the same for all services, most likely. wdyt?

---

<div class="post-metadata">

**Author:** ![bootstraponline](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bootstraponline](https://discuss.bitrise.io/u/bootstraponline)\
**Post date:** [March 29, 2018, 3:00pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/6 "2018-03-29T15:00:34Z")

</div>

Maybe try a GITHUB step first and see what happens. I agree that seems to better align with the overall Bitrise vision.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [March 29, 2018, 3:48pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/7 "2018-03-29T15:48:51Z")

</div>

I agree - will bring up for a discussion with the team!

---

<div class="post-metadata">

**Author:** ![mamata](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mamata](https://discuss.bitrise.io/u/mamata)\
**Post date:** [October 15, 2019, 12:23pm UTC](https://discuss.bitrise.io/t/expose-github-pull-request-link-in-environment-variable/4609/8 "2019-10-15T12:23:26Z")

</div>

@viktorbenei Any update on this?
