kopia lustrzana https://github.com/badgen/badgen.net
Update appveyor to live badge
rodzic
93173d1736
commit
171cfbccc4
|
@ -62,7 +62,7 @@ Available color names:
|
|||
| travis |  | [/travis/amio/micro-cors](/travis/amio/micro-cors)
|
||||
| travis (org) |  | [/travis-org/styfle/packagephobia](/travis-org/styfle/packagephobia)
|
||||
| circleci |  | [/circleci/github/amio/now-go](/circleci/github/amio/now-go)
|
||||
| appveyor |  | [/appveyor/github/gruntjs/grunt](/appveyor/github/gruntjs/grunt)
|
||||
| appveyor ci |  | [/appveyor/ci/gruntjs/grunt](/appveyor/ci/gruntjs/grunt)
|
||||
|
||||
## About
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
module.exports = {
|
||||
'appveyor': require('./appveyor.js'),
|
||||
'chrome-web-store': require('./chrome-web-store.js'),
|
||||
'crates': require('./crates.js'),
|
||||
'homebrew': require('./homebrew.js'),
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
const axios = require('../axios.js')
|
||||
|
||||
module.exports = async function (topic, ...args) {
|
||||
switch (topic) {
|
||||
case 'ci':
|
||||
return ci(...args)
|
||||
default:
|
||||
return {
|
||||
subject: 'appveyor',
|
||||
status: 'unknown',
|
||||
color: 'grey'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function ci (account, project, branch) {
|
||||
branch = branch ? `/branch/${branch}` : ''
|
||||
const endpoint = `https://ci.appveyor.com/api/projects/${account}/${project}${branch}`
|
||||
const { build } = await axios.get(endpoint).then(res => res.data)
|
||||
return {
|
||||
subject: 'build',
|
||||
status: build.status,
|
||||
color: build.status === 'success' ? 'green' : 'red'
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
module.exports = {
|
||||
'appveyor': require('./appveyor.js'),
|
||||
'circleci': require('./circleci.js'),
|
||||
'travis': require('./travis.js'),
|
||||
'travis-org': require('./travis-org.js')
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = function (...args) {
|
||||
return `https://ci.appveyor.com/api/projects/status/${args.join('/')}?branch=master&svg=true`
|
||||
}
|
Ładowanie…
Reference in New Issue