Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Expose addLabels, removeLabels via gitlab.utils #1353

Merged
merged 3 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<!-- Your comment below this -->

- Feature: Expose addLabels, removeLabels via gitlab.utils, @glensc #1353
- Fix remote dangerfiles always parsing as JavaScript. TypeScript files should now work properly. - [@snowe2010]
- Add support for BitBucket Cloud Repository Access Token - [@thawankeane]

Expand Down Expand Up @@ -1966,6 +1967,7 @@ Not usable for others, only stubs of classes etc. - [@orta]
[@fwal]: https://github.com/fwal
[@g3offrey]: https://github.com/g3offrey
[@gantman]: https://github.com/gantman
[@glensc]: https://github.com/glensc
[@gpetrioli]: https:/github.com/gpetrioli
[@gzaripov]: https://github.com/gzaripov
[@hanneskaeufler]: https://github.com/hanneskaeufler
Expand Down
2 changes: 2 additions & 0 deletions source/dsl/GitLabDSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface GitLabJSONDSL {
export interface GitLabDSL extends GitLabJSONDSL {
utils: {
fileContents(path: string, repoSlug?: string, ref?: string): Promise<string>
addLabels(...labels: string[]): Promise<boolean>
removeLabels(...labels: string[]): Promise<boolean>
}
api: InstanceType<typeof Gitlab>
}
Expand Down
2 changes: 2 additions & 0 deletions source/platforms/GitLab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export const gitlabJSONToGitLabDSL = (gl: GitLabDSL, api: GitLabAPI): GitLabDSL
...gl,
utils: {
fileContents: api.getFileContents,
addLabels: api.addLabels,
removeLabels: api.removeLabels,
},
api: api.apiInstance,
})