Skip to content

Commit

Permalink
Merge pull request #1353 from danger/1314-expose-gitlab-add-remove-la…
Browse files Browse the repository at this point in the history
…bels

Feature: Expose addLabels, removeLabels via gitlab.utils
  • Loading branch information
orta authored Mar 2, 2023
2 parents 89fabea + 1b5bd85 commit 799ee20
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
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,
})

0 comments on commit 799ee20

Please sign in to comment.