time-rs/time status badge
const axios = require('axios');
exports.endpoint = async function (req, response) {
const { message } = (await axios.get('https://img.shields.io/github/workflow/status/time-rs/time/Build.json')).data;
response.setHeader('Content-Type', 'application/json');
if (message === 'passing') {
response.end(JSON.stringify({
schemaVersion: 1,
label: 'Build',
message: 'passing',
namedLogo: 'github',
style: 'for-the-badge',
color: '779a6b',
}));
} else {
response.end(JSON.stringify({
schemaVersion: 1,
label: 'Build',
message: 'failing',
namedLogo: 'github',
style: 'for-the-badge',
color: 'c18170',
}));
}
}
no comments