Files
shields/lib/github-helpers.js
Paul Melnikow bb66a99a66 [GitHub] Issue and pull request detail and check state (#1114)
This adds badges for Github issues and pull requests. You can display the state, title, username, number of comments, age, time since last update, and state of checks.

Provides an endpoint the Shields CI can use to fetch PR titles for #979 and resolves #1011.
2017-10-02 13:26:42 -04:00

20 lines
428 B
JavaScript

'use strict';
const { colorScale } = require('./color-formatters');
function stateColor(s) {
return { open: '2cbe4e', closed: 'cb2431', merged: '6f42c1' }[s];
}
function checkStateColor(s) {
return { pending: 'dbab09', success: '2cbe4e', failure: 'cb2431', error: 'cb2431' }[s];
}
const commentsColor = colorScale([1, 3, 10, 25], undefined, true);
module.exports = {
stateColor,
checkStateColor,
commentsColor
};