How can I add commit ID to build version?
I want to add commit ID to my build version.
I changed the first line of appveyor.yml like below.
version: 0.0.1_%APPVEYOR_REPO_COMMIT%
Now a project is being built and the CONSOLE is showing nothing.
I think something maybe hang due to the wrong format of version.
I want to cancel this build but it doesn't response to me.
So what is the correct format of version to add commit id?
And please help me to cancel the build!!!
Update: now this build is stopped after running nearly 40 minutes.
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | 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

Support Staff 1 Posted by Feodor Fitsner on 23 Aug, 2015 04:37 PM
It won't be expanded like that. There could only two variables within version format:
{build}and{branch}.If you want to add commit id to a build version you can do that using this API. With a little PS script like that:
2 Posted by lsmgeb89 on 23 Aug, 2015 04:55 PM
Thank you for your solution and quick reply.
Another question:
Can I delete a failure build record in the project history?
Support Staff 3 Posted by Feodor Fitsner on 23 Aug, 2015 04:56 PM
Nope, it can't be deleted.
4 Posted by lsmgeb89 on 23 Aug, 2015 05:06 PM
OK, thx, I want to return something related to my first question.
How can I refer updated build version in the cmdlet or powershell after adding init script in the init part?
I use %APPVEYOR_BUILD_VERSION% in the cmd, but it remains the old version number.
Support Staff 5 Posted by Feodor Fitsner on 23 Aug, 2015 05:42 PM
It depends on how/when you change build version.
I've just tested here and it worked:
https://github.com/FeodorFitsner/nuget-test/blob/master/appveyor.ym...
Build results:
https://ci.appveyor.com/project/FeodorFitsner/nuget-test/build/0.0....
6 Posted by lsmgeb89 on 24 Aug, 2015 03:01 AM
After checking my yml file, I have found my problem.
I restart machine after changing build version.
So Changing it after restarting machine solved the problem.
Thank you for your all great help.
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:59 AM.