Render template with CI enviroment injected by Drone CI.

Usage no npm install needed!

<script type="module">
  import droneRender from 'https://cdn.skypack.dev/drone-render';



npm Travis Coveralls David

Render template with CI enviroment injected by Drone CI.


npm install drone-render --save

How To Use

const render = require('drone-render');
{% if build.status %}
  {{build.finished | datetime('fromNow')}} build {{build.number}} succeeded. Good job {{build.author}}.
{% else %}
  build {{build.number}} failed at {{build.finished | datetime}}. Fix me please.
{% endif %}

//a day ago build 20 succeeded. Good job lord.

Template Reference

  • repo.owner: repository owner
  • repo.name: repository name
  • build.status: build status type enumeration, either success or failure
  • build.event: build event type enumeration, one of push, pull_request, tag, deployment
  • build.number: build number
  • build.commit: git sha for current commit
  • build.message: commit message for the current build
  • build.branch: git branch for current commit
  • build.tag: git tag for current commit
  • build.ref: git ref for current commit
  • build.pull_request: pull request number for the current build
  • build.source_branch: source branch for a pull request
  • build.target_branch: target branch for a pull request
  • build.author: git author for current commit
  • build.link: link the the build results in drone
  • build.started: unix timestamp for build started
  • build.finished: unix timestamp for build finished

Template Filter

  • uppercasefirst: converts the first letter of a string to uppercase
  • datetime: converts a unix timestamp to a date time string. Example {{build.started | datetime}}, you can see more info in nunjucks-date-filter
  • More filter can see builtin-filters


Contributions welcome!