# Is the git reference exposed to the imported Travis Shared Build Configs?

**URL:** <https://travis-ci.community/t/is-the-git-reference-exposed-to-the-imported-travis-shared-build-configs/6648>\
**Category:** Travis CI Discussions & Feedback\
**Tags:** config-import\
**Created:** [December 27, 2019, 11:50pm UTC](https://travis-ci.community/t/is-the-git-reference-exposed-to-the-imported-travis-shared-build-configs/6648 "2019-12-27T23:50:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![balupton](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/balupton/32/3515_2.png) [@balupton](https://travis-ci.community/u/balupton)\
**Post date:** [December 27, 2019, 11:50pm UTC](https://travis-ci.community/t/is-the-git-reference-exposed-to-the-imported-travis-shared-build-configs/6648/1 "2019-12-27T23:50:02Z")

</div>

Regarding [https://docs.travis-ci.com/user/build-config-imports](https://docs.travis-ci.com/user/build-config-imports)

I currently maintain [https://github.com/bevry/awesome-travis](https://github.com/bevry/awesome-travis) which has several scripts that be added to a `.travis.yml` file, such as [https://github.com/bevry/awesome-travis/blob/master/scripts/node-install.bash](https://github.com/bevry/awesome-travis/blob/master/scripts/node-install.bash) which is added by doing:

```auto
install:
  - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/c91c9d5eef34ecb0e92029667fd5052640225fa3/scripts/node-install.bash)"

```

I am considering putting the above into a `node-install.yml` file that can then be imported via:

```auto
import:
  - bevry/awesome-travis:node-install.yml@c91c9d5eef34ecb0e92029667fd5052640225fa3

```

However, it would be frustrating for me to have to update `bevry/awesome-travis:node-install.yml` on every single update with the latest commit hash.

I could omit the commit information, but that would be dangerous to the stability of people’s CI builds.

It would be nice if merging provided an environment variable that is replaced on merge, something like:

```auto
install:
  - eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/$TRAVIS_CONFIG_REFERENCE/scripts/node-install.bash)"

```

Such that doing

```auto
import:
  - bevry/awesome-travis:node-install.yml@c91c9d5eef34ecb0e92029667fd5052640225fa3

```

Replaces `$TRAVIS_CONFIG_REFERENCE` with `c91c9d5eef34ecb0e92029667fd5052640225fa3` on merge.

Or:

```auto
import:
  - bevry/awesome-travis:node-install.yml@master

```

Replaces `$TRAVIS_CONFIG_REFERENCE` with `master` on merge.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [December 28, 2019, 4:03am UTC](https://travis-ci.community/t/is-the-git-reference-exposed-to-the-imported-travis-shared-build-configs/6648/2 "2019-12-28T04:03:54Z")

</div>

> [@balupton](#):
>
> I am considering putting the above into a `node-install.yml` file that can then be imported via:

Not a good idea. Because [you can’t import parts of a list section, only insert or replace it in full](https://travis-ci.community/t/import-different-files-into-different-jobs/6292/3) – and such a command is likely to be only a part of an `install`/`script` section’s logic.

- An alternative to that command is asking to add your project as a submodule. E.g. [GitHub - matthew-brett/multibuild: Machinery for building and testing Python Wheels for Linux, OSX and (less flexibly) Windows.](https://github.com/matthew-brett/multibuild) does that.
- Another alternative is to make releases (tags) or a “rolling release” in the form of a “stable branch”. Or ensure that your `master` is stable enough (i.e. add some kind of scrutiny to commits that go there).
  - Multibuild’s experience shows though that [_“check out the newest commit from `devel` that works for you, then stay at it until you need newer features”_](https://github.com/matthew-brett/multibuild/blob/devel/README.rst#multibuild-development) is usually good enough. It might not be good enough for you if e.g. download URLs change too quickly and one cannot continue using old ones.

---

<div class="post-metadata">

**Author:** ![balupton](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/balupton/32/3515_2.png) [@balupton](https://travis-ci.community/u/balupton)\
**Post date:** [November 23, 2020, 7:38am UTC](https://travis-ci.community/t/is-the-git-reference-exposed-to-the-imported-travis-shared-build-configs/6648/3 "2020-11-23T07:38:43Z")

</div>

This can be closed. I moved to Github Actions, which has native composability.
