Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

drone-render

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drone-render

Render template with CI enviroment injected by Drone CI.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

drone-render

npm Travis Coveralls David

Render template with CI enviroment injected by Drone CI.

Installation

npm install drone-render --save

How To Use


const render = require('drone-render');
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 %}
`);

//output
//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

Contributing

Contributions welcome!

License

MIT

Keywords

FAQs

Package last updated on 04 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc