tag:help.appveyor.com,2012-11-13:/discussions/questions/2590-put-commit-number-into-artifacts-archiveAppVeyor: Discussion 2018-08-25T02:08:06Ztag:help.appveyor.com,2012-11-13:Comment/406110622016-08-25T22:27:32Z2016-08-25T22:28:10ZPut commit number into artifacts archive <div><p>Hi,</p>
<p>You can use APPVEYOR_REPO_COMMIT environment variable. Number of
other useful variables can be found here <a href="https://www.appveyor.com/docs/environment-variables/">https://www.appveyor.com/docs/environment-variables/</a></p>
<p>Here is appveyor.yml section example you can use:</p>
<pre>
<code>install:
- ps: '[System.IO.File]::WriteAllText("$env:APPVEYOR_BUILD_FOLDER\version.txt", $env:APPVEYOR_REPO_COMMIT)'
artifacts:
- path: version.txt
name: version</code>
</pre>
<p>Hope this helps.</p>
<p>--ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/406110622016-08-26T06:11:34Z2016-08-26T06:11:34ZPut commit number into artifacts archive <div><p>Thanks, it works :)<br>
Only I'm used after_build:<br></p>
<pre>
<code>after_build:
- ps: '[System.IO.File]::WriteAllText("$env:APPVEYOR_BUILD_FOLDER\source\bin\$env:CONFIGURATION\version.txt", $env:APPVEYOR_REPO_COMMIT)'
artifacts:
- path: source\bin\Release
name: Release</code>
</pre></div>mogikanin.tirtag:help.appveyor.com,2012-11-13:Comment/406110622016-08-26T17:38:02Z2016-08-26T17:38:02ZPut commit number into artifacts archive <div><p>Yes, after_build is more logical place for this, I agree :)</p></div>Ilya Finkelshteyn