<p>Screwdriver now supports commenting on pull requests through Screwdriver build meta. This feature allows users to add custom data such as coverage results to the Git pull request.</p>
<p><b>Screwdriver Users</b></p>
<p>To add a comment to a pull request build, Screwdriver users can configure their screwdriver.yaml with steps as shown below:</p>
<pre><code>jobs:
main:
steps:
- postdeploy: |
meta set meta.summary.coverage "Coverage increased by 15%"
meta set meta.summary.markdown "this markdown comment is **bold** and *italic*"
</code></pre>
<p>These commands will result in a comment in Git that will look something like:</p>
<figure class="tmblr-full" data-orig-height="562" data-orig-width="1560"><img src="https://66.media.tumblr.com/8884865d72b679cfd23edc2b64bd02e8/tumblr_inline_pl51vvKXKd1uvhog4_540.png" data-orig-height="562" data-orig-width="1560"/></figure><p><!-- more --></p>
<p><b>Cluster Admins</b></p>
<p>In order to enable meta PR comments, you’ll need to create a bot user in Git with a personal access token with the <code>public_repo</code> scope. In Github, create a new user. Follow instructions to <a href="https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line">create a personal access token</a>, set the scope as <code>public_repo</code>. Copy this token and set it as <code>commentUserToken</code> in your <code>scms</code> settings in your <a href="https://github.com/screwdriver-cd/screwdriver/blob/master/config/custom-environment-variables.yaml#L268-L269">API config yaml</a>.</p>
<p>You need this headless user for commenting since Github requires <code>public_repo</code> scope in order to comment on pull requests (<a href="https://github.community/t5/How-to-use-Git-and-GitHub/Why-does-GitHub-API-require-admin-rights-to-leave-a-comment-on-a/td-p/357">https://github.community/t5/How-to-use-Git-and-GitHub/Why-does-GitHub-API-require-admin-rights-to-leave-a-comment-on-a/td-p/357</a>). For more information about Github scope, see <a href="https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps">https://developer.github.com/apps/building-oauth-apps/understanding-scopes-for-oauth-apps</a>.</p>
<h2>Compatibility List</h2>
<p>In order to use the new meta PR comments feature, you will need these minimum versions:</p>
<ul><li><a href="https://hub.docker.com/r/screwdrivercd/screwdriver">API</a>:v0.5.545</li>
</ul><h2>Contributors</h2>
<p>Thanks to the following people for making this feature possible:</p>
<ul><li><a href="https://github.com/tkyi"><b>tkyi</b></a></li>
</ul><p>Screwdriver is an open-source build automation platform designed for Continuous Delivery. It is built (and used) by Yahoo. Don’t hesitate to reach out if you have questions or would like to contribute: <a href="http://docs.screwdriver.cd/about/support.">http://docs.screwdriver.cd/about/support.</a></p>