fix(templates/markdown): support repository (#850) [skip ci]

This commit is contained in:
Simon Lecoq
2022-02-08 03:23:39 +01:00
committed by GitHub
parent c47dfba1fc
commit cb1bba87d5
2 changed files with 3 additions and 2 deletions

View File

@@ -505,11 +505,11 @@ metadata.template = async function({__templates, name, plugins}) {
if (account !== "bypass") { if (account !== "bypass") {
const context = q.repo ? "repository" : account const context = q.repo ? "repository" : account
if ((Array.isArray(this.supports)) && (!this.supports.includes(context))) if ((Array.isArray(this.supports)) && (!this.supports.includes(context)))
throw new Error(`not supported for: ${context}`) throw new Error(`template not supported for: ${context}`)
} }
//Format check //Format check
if ((format) && (Array.isArray(this.formats)) && (!this.formats.includes(format))) if ((format) && (Array.isArray(this.formats)) && (!this.formats.includes(format)))
throw new Error(`not supported for: ${format}`) throw new Error(`template not supported for: ${format}`)
}, },
} }
} }

View File

@@ -6,6 +6,7 @@ index: 3
supports: supports:
- user - user
- organization - organization
- repository
formats: formats:
- markdown - markdown
- markdown-pdf - markdown-pdf