convert some service classes to static fields, run [GithubPipenv GithubPullRequestCheckState GithubReleaseDate GithubRelease GithubRepoSize] (#5622)
* refactor(githubpipenv): convert to static fields * refactor(githubpullrequest): convert to static fields * refactor(githubreleasedate): convert to static fields * refactor(githubrelease): convert to static fields * refactor(githubreposize): convert to static fields
This commit is contained in:
@@ -20,56 +20,44 @@ const schema = Joi.object({
|
||||
const keywords = ['pullrequest', 'detail']
|
||||
|
||||
module.exports = class GithubPullRequestCheckState extends GithubAuthV3Service {
|
||||
static get category() {
|
||||
return 'build'
|
||||
static category = 'build'
|
||||
static route = {
|
||||
base: 'github/status',
|
||||
pattern: ':variant(s|contexts)/pulls/:user/:repo/:number(\\d+)',
|
||||
}
|
||||
|
||||
static get route() {
|
||||
return {
|
||||
base: 'github/status',
|
||||
pattern: ':variant(s|contexts)/pulls/:user/:repo/:number(\\d+)',
|
||||
}
|
||||
}
|
||||
|
||||
static get examples() {
|
||||
return [
|
||||
{
|
||||
title: 'GitHub pull request check state',
|
||||
pattern: 's/pulls/:user/:repo/:number',
|
||||
namedParams: {
|
||||
user: 'badges',
|
||||
repo: 'shields',
|
||||
number: '1110',
|
||||
},
|
||||
staticPreview: this.render({ variant: 's', state: 'pending' }),
|
||||
keywords,
|
||||
documentation,
|
||||
static examples = [
|
||||
{
|
||||
title: 'GitHub pull request check state',
|
||||
pattern: 's/pulls/:user/:repo/:number',
|
||||
namedParams: {
|
||||
user: 'badges',
|
||||
repo: 'shields',
|
||||
number: '1110',
|
||||
},
|
||||
{
|
||||
title: 'GitHub pull request check contexts',
|
||||
pattern: 'contexts/pulls/:user/:repo/:number',
|
||||
namedParams: {
|
||||
user: 'badges',
|
||||
repo: 'shields',
|
||||
number: '1110',
|
||||
},
|
||||
staticPreview: this.render({
|
||||
variant: 'contexts',
|
||||
state: 'pending',
|
||||
stateCounts: { passed: 5, pending: 1 },
|
||||
}),
|
||||
keywords,
|
||||
documentation,
|
||||
staticPreview: this.render({ variant: 's', state: 'pending' }),
|
||||
keywords,
|
||||
documentation,
|
||||
},
|
||||
{
|
||||
title: 'GitHub pull request check contexts',
|
||||
pattern: 'contexts/pulls/:user/:repo/:number',
|
||||
namedParams: {
|
||||
user: 'badges',
|
||||
repo: 'shields',
|
||||
number: '1110',
|
||||
},
|
||||
]
|
||||
}
|
||||
staticPreview: this.render({
|
||||
variant: 'contexts',
|
||||
state: 'pending',
|
||||
stateCounts: { passed: 5, pending: 1 },
|
||||
}),
|
||||
keywords,
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
label: 'checks',
|
||||
namedLogo: 'github',
|
||||
}
|
||||
}
|
||||
static defaultBadgeData = { label: 'checks', namedLogo: 'github' }
|
||||
|
||||
static render({ variant, state, stateCounts }) {
|
||||
let message
|
||||
|
||||
Reference in New Issue
Block a user