docs(dependabot): add example and description (#372)

pull/374/head
晋晓炜 Amio / 2020-04-05 23:07:11 +08:00 zatwierdzone przez GitHub
rodzic b339c1b735
commit 95065ae8f9
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -2,6 +2,15 @@ import got from '../libs/got'
import { createBadgenHandler, PathArgs } from '../libs/create-badgen-handler'
const help = `
## Public repositories
To enable dependabot on a public repo (for the badge to working), you need to either
- login at https://app.dependabot.com/ then add it manually,
- or add a [\`.dependabot/config.yml\`](https://dependabot.com/docs/config-file/) file to the repo.
Then you may include the badge in your repo like [this PR](https://github.com/thepracticaldev/dev.to/pull/3268).
## Private repositories
In order to use the dependabot badge with a private GitHub repository you will need to get its id. You can use the [GitHub API](https://developer.github.com/v3/) and [curl](https://curl.haxx.se/docs/manual.html) to do this like so:
<pre>
@ -37,7 +46,8 @@ export default createBadgenHandler({
title: 'Dependabot',
help,
examples: {
'/dependabot/dependabot/dependabot-core/?icon=dependabot': 'status'
'/dependabot/thepracticaldev/dev.to?icon=dependabot': 'status',
'/dependabot/dependabot/dependabot-core?icon=dependabot': 'status'
},
handlers: {
'/dependabot/:owner/:repo/:identifier?': handler