Files
shields/services/gitlab/gitlab-base.js
Caleb Cartwright 961e13b229 Add API-based support for [GitLab] badges, add new GitLab Tag badge (#6988)
* Added GitLab Tag service

* Added prettyMessage for when repo has no tags

* Added pretty message for repo not found

* core: esm-ify gitlab tag service

* feat: support gitlab auth

* feat: support custom gitlab url on tag badges

* tests: add auth test for gitlab

* docs: fix gitlab config key references

* feat: support gitlab tag sorting options

* docs: add custom gitlab instance example for tags badge

* use v in gitlab route

* fix: gitlab tag examples

Co-authored-by: Ideotec <guille@ideotec.es>
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2021-09-14 23:06:57 +00:00

20 lines
398 B
JavaScript

import { BaseJsonService } from '../index.js'
export default class GitLabBase extends BaseJsonService {
static auth = {
passKey: 'gitlab_token',
serviceKey: 'gitlab',
}
async fetch({ url, options, schema, errorMessages }) {
return this._requestJson(
this.authHelper.withBasicAuth({
schema,
url,
options,
errorMessages,
})
)
}
}