Move github examples into services/github (#2309)

This commit is contained in:
Paul Melnikow
2018-11-15 15:57:56 -05:00
committed by GitHub
parent 5d63effabc
commit fe05d00747
22 changed files with 667 additions and 319 deletions

View File

@@ -3,10 +3,33 @@
const LegacyService = require('../legacy-service')
const { makeBadgeData: getBadgeData } = require('../../lib/badge-data')
const {
documentation,
checkErrorResponse: githubCheckErrorResponse,
} = require('./github-helpers')
module.exports = class GithubCommitStatus extends LegacyService {
static get category() {
return 'other'
}
static get route() {
return {
base: 'github/commit-status',
}
}
static get examples() {
return [
{
title: 'GitHub commit merge status',
previewUrl:
'badges/shields/master/5d4ab86b1b5ddfb3c4a70a70bd19932c52603b8c',
keywords: ['GitHub', 'commit', 'branch', 'merge'],
documentation,
},
]
}
static registerLegacyRouteHandler({ camp, cache, githubApiProvider }) {
camp.route(
/^\/github\/commit-status\/([^/]+)\/([^/]+)\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,