Skip to content

Commit 5858fcb

Browse files
authored
Merge pull request #275 from Kyr/patch-1
feat: Add missing method for triggering pipelines
2 parents 1d6e6e2 + 8d915c8 commit 5858fcb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/infrastructure/RequestHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export interface RequestOptions {
183183
search?: string;
184184
public?: boolean;
185185
text?: string;
186+
token?: string;
186187
}
187188

188189
class RequestHelper {

src/services/Triggers.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ class Triggers extends BaseService {
3333

3434
return RequestHelper.get(this, `projects/${pId}/triggers/${tId}`);
3535
}
36+
37+
pipeline(projectId: ProjectId, options: RequestOptions) {
38+
if (!options.ref) throw new Error('Missing required property: ref');
39+
if (!options.token) throw new Error('Missing required property: token');
40+
41+
const pId = encodeURIComponent(projectId);
42+
43+
return RequestHelper.post(this, `projects/${pId}/trigger/pipeline`, options);
44+
}
3645
}
3746

3847
export default Triggers;

0 commit comments

Comments
 (0)