Add github style short hash to the environment variables

Eric J. Smith's Avatar

Eric J. Smith

03 Mar, 2015 10:31 PM

Right now I am doing this in my scripts:

$env:GIT_HASH = $env:APPVEYOR_REPO_COMMIT.Substring(0, 10)

It would be nice if you had a short hash created for us automatically.

Also, I am trying to use an environment variable in my assembly info like this:

  patch: true
  assembly_informational_version: "{version} $($env:GIT_HASH)"

But the variable doesn't get expanded. How can I use variables in there?

  1. Support Staff 1 Posted by Feodor Fitsner on 03 Mar, 2015 10:39 PM

    Feodor Fitsner's Avatar

    It should be just:

      patch: true 
      assembly_informational_version: "{version} $(GIT_HASH)"
  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:54 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac