# Obtaining a URL to a file in a GitHub repository in a Travis CI build

DevFeed: [Obtaining a URL to a file in a GitHub repository in a Travis CI build](<https://devfeed.tech/articles/obtaining-a-url-to-a-file-in-a-github-repository-in-a-travis-ci-build-21502.md>)

Original publisher: [Read original article](<https://mirocupak.com/obtaining-a-url-to-a-file-in-a-github-repository-in-a-travis-ci-build/>)

Published: 2019-01-24T22:51:37Z

Content type: tutorial

Language: en

Sources: [Miro Cupak](<https://devfeed.tech/sources/miro-cupak.md>)

Topics: [ci](<https://devfeed.tech/topics/ci.md>), [GitHub](<https://devfeed.tech/topics/github.md>), [pull-requests](<https://devfeed.tech/topics/pull-requests.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [Swagger](<https://devfeed.tech/topics/swagger.md>)

Tags: [ci](<https://devfeed.tech/tags/ci.md>), [continuous-integration](<https://devfeed.tech/tags/continuous-integration.md>), [devops](<https://devfeed.tech/tags/devops.md>), [github](<https://devfeed.tech/tags/github.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [openapi-specification](<https://devfeed.tech/tags/openapi-specification.md>), [pull-requests](<https://devfeed.tech/tags/pull-requests.md>), [swagger](<https://devfeed.tech/tags/swagger.md>), [travis](<https://devfeed.tech/tags/travis.md>), [travis-ci](<https://devfeed.tech/tags/travis-ci.md>)

## AI overview

A tutorial explaining how to construct a URL to a repository file in a Travis CI build while accounting for push builds, pull requests from forks, branches, and tags.

## Source excerpt

I'm a fan of Travis CI and use it for continuous integration across pretty much all my open-source projects on GitHub. From time to time, I need to obtain a URL to a file in the repository in my build, e.g. to point a particular tool to it, in a way that respects branches as well as pull requests...