Class: GithubPlatform
@pvm/plugin-github.GithubPlatform
Hierarchy
PlatformInterface
<PullRequest
>↳
GithubPlatform
Constructors
constructor
• new GithubPlatform(__namedParameters
)
Parameters
Name | Type |
---|---|
__namedParameters | Object |
__namedParameters.config | Config |
Overrides
Defined in
src/plugins/github/platform.ts:102
Properties
config
• Private
config: Config
Defined in
src/plugins/github/platform.ts:56
currentMr
• currentMr: null
| {} = null
Overrides
Defined in
src/plugins/github/platform.ts:53
githubClient
• Private
githubClient: Octokit
& {} & Api
& {}
Defined in
src/plugins/github/platform.ts:54
githubRepoPath
• Private
githubRepoPath: Object
Type declaration
Name | Type |
---|---|
owner | string |
repo | string |
Defined in
src/plugins/github/platform.ts:55
Methods
addTag
▸ addTag(ref
, tag_name
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
ref | string |
tag_name | string |
Returns
Promise
<unknown
>
Overrides
Defined in
src/plugins/github/platform.ts:214
addTagAndRelease
▸ addTagAndRelease(ref
, tag_name
, data
): Promise
<AlterReleaseResult
>
Создает и тег и релиз, если тег уже есть то выбрасывается исключение
Parameters
Name | Type |
---|---|
ref | string |
tag_name | string |
data | CreateReleasePayload |
Returns
Promise
<AlterReleaseResult
>
Overrides
PlatformInterface.addTagAndRelease
Defined in
src/plugins/github/platform.ts:222
beginMrAttribution
▸ beginMrAttribution(): Promise
<void
>
Returns
Promise
<void
>
Overrides
PlatformInterface.beginMrAttribution
Defined in
src/plugins/github/platform.ts:196
createMrNote
▸ createMrNote(noteBody
): Promise
<Object
>
Parameters
Name | Type |
---|---|
noteBody | string |
Returns
Promise
<Object
>
Overrides
PlatformInterface.createMrNote
Defined in
src/plugins/github/platform.ts:328
createProjectLabel
▸ createProjectLabel(label
, color
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
label | string |
color | string |
Returns
Promise
<unknown
>
Overrides
PlatformInterface.createProjectLabel
Defined in
src/plugins/github/platform.ts:362
createRelease
▸ createRelease(tag_name
, data
): Promise
<AlterReleaseResult
>
Создает релиз на существующем теге
Parameters
Name | Type |
---|---|
tag_name | string |
data | CreateReleasePayload |
Returns
Promise
<AlterReleaseResult
>
Overrides
PlatformInterface.createRelease
Defined in
src/plugins/github/platform.ts:238
editRelease
▸ editRelease(tag
, data
): Promise
<AlterReleaseResult
>
Редактирует существующий релиз, если нет релиза или тега будет ошибка
Parameters
Name | Type |
---|---|
tag | string |
data | CreateReleasePayload |
Returns
Promise
<AlterReleaseResult
>
Overrides
Defined in
src/plugins/github/platform.ts:259
ensureMrLabels
▸ ensureMrLabels(labels
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
labels | string [] |
Returns
Promise
<unknown
>
Inherited from
PlatformInterface.ensureMrLabels
Defined in
packages/pvm-vcs/lib/platform-interface.ts:62
fetchLatestSha
▸ fetchLatestSha(refName
): Promise
<string
>
Parameters
Name | Type |
---|---|
refName | string |
Returns
Promise
<string
>
Overrides
PlatformInterface.fetchLatestSha
Defined in
src/plugins/github/platform.ts:386
findMrNote
▸ findMrNote(kind
): Promise
<void
| MetaComment
<{} & { body
: string
}>>
Parameters
Name | Type |
---|---|
kind | string |
Returns
Promise
<void
| MetaComment
<{} & { body
: string
}>>
Overrides
Defined in
src/plugins/github/platform.ts:292
getCommitLink
▸ getCommitLink(commit
): Promise
<string
>
Parameters
Name | Type |
---|---|
commit | string |
Returns
Promise
<string
>
Overrides
PlatformInterface.getCommitLink
Defined in
src/plugins/github/platform.ts:378
getCommitSha
▸ getCommitSha(): string
Returns
string
Overrides
PlatformInterface.getCommitSha
Defined in
src/plugins/github/platform.ts:396
getCurrentBranch
▸ getCurrentBranch(): undefined
| string
Returns
undefined
| string
Overrides
PlatformInterface.getCurrentBranch
Defined in
src/plugins/github/platform.ts:382
getProjectLabels
▸ getProjectLabels(): AsyncIterable
<Object
>
Returns
AsyncIterable
<Object
>
Overrides
PlatformInterface.getProjectLabels
Defined in
src/plugins/github/platform.ts:352
getRelease
▸ getRelease(tagName
): Promise
<GetReleaseResult
>
Возвращает релиз, если есть, для существующего тега. Результат если тега нет или нет релиза отличается по коду ответа
Parameters
Name | Type |
---|---|
tagName | string |
Returns
Promise
<GetReleaseResult
>
Overrides
Defined in
src/plugins/github/platform.ts:129
getUpdateHintsByCommit
▸ getUpdateHintsByCommit(_commit
): Promise
<null
| Record
<string
, any
>>
Parameters
Name | Type |
---|---|
_commit | string |
Returns
Promise
<null
| Record
<string
, any
>>
Overrides
PlatformInterface.getUpdateHintsByCommit
Defined in
src/plugins/github/platform.ts:400
logReleaseTag
▸ Private
logReleaseTag(tagName
): void
Parameters
Name | Type |
---|---|
tagName | string |
Returns
void
Defined in
src/plugins/github/platform.ts:404
releaseTagsIterator
▸ releaseTagsIterator(): AsyncGenerator
<PlatformReleaseTag
, void
, any
>
Returns
AsyncGenerator
<PlatformReleaseTag
, void
, any
>
Overrides
PlatformInterface.releaseTagsIterator
Defined in
src/plugins/github/platform.ts:169
releasesIterator
▸ releasesIterator(): AsyncGenerator
<VcsRelease
, void
, any
>
Returns
AsyncGenerator
<VcsRelease
, void
, any
>
Overrides
PlatformInterface.releasesIterator
Defined in
src/plugins/github/platform.ts:148
requireMr
▸ requireMr(): Object
Returns
Object
Overrides
Defined in
src/plugins/github/platform.ts:188
setMrLabels
▸ setMrLabels(labels
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
labels | string [] |
Returns
Promise
<unknown
>
Overrides
Defined in
src/plugins/github/platform.ts:370
setupClientHooks
▸ Private
setupClientHooks(): void
Returns
void
Defined in
src/plugins/github/platform.ts:117
syncAttachment
▸ syncAttachment(_kind
, _attachment
, _opts
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
_kind | string |
_attachment | Buffer |
_opts | any |
Returns
Promise
<unknown
>
Overrides
PlatformInterface.syncAttachment
Defined in
src/plugins/github/platform.ts:348
syncText
▸ syncText(kind
, text
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
kind | string |
text | string |
Returns
Promise
<unknown
>
Inherited from
Defined in
packages/pvm-vcs/lib/platform-interface.ts:50
updateMrNote
▸ updateMrNote(commentId
, noteBody
): Promise
<Object
>
Parameters
Name | Type |
---|---|
commentId | number |
noteBody | string |
Returns
Promise
<Object
>
Overrides
PlatformInterface.updateMrNote
Defined in
src/plugins/github/platform.ts:338
upsertRelease
▸ upsertRelease(tagName
, data
): Promise
<AlterReleaseResult
>
Редактирует или создает релиз, тег должен существовать
Parameters
Name | Type |
---|---|
tagName | string |
data | CreateReleasePayload |
Returns
Promise
<AlterReleaseResult
>
Overrides
PlatformInterface.upsertRelease
Defined in
src/plugins/github/platform.ts:276
getAuthStrategy
▸ Static
getAuthStrategy(config
): undefined
| (options
: StrategyOptions
) => AuthInterface
| StrategyInterface
<[], [], Authentication
>
Parameters
Name | Type |
---|---|
config | Config |
Returns
undefined
| (options
: StrategyOptions
) => AuthInterface
| StrategyInterface
<[], [], Authentication
>
Defined in
src/plugins/github/platform.ts:58
getRepoUrlParts
▸ Static
getRepoUrlParts(cwd
): Object
Parameters
Name | Type |
---|---|
cwd | string |
Returns
Object
Name | Type |
---|---|
owner | string |
repo | string |