Skip to content

Commit

Permalink
Update documentation for new feature
Browse files Browse the repository at this point in the history
Signed-off-by: snehajais22 <[email protected]>
  • Loading branch information
snehajais22 committed Jul 19, 2024
1 parent dbdb089 commit 0f960e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
15 changes: 10 additions & 5 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions src/builders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,8 +893,10 @@ export class TaskBuilder {
}

/**
* TODO
* @param task TODO
* Sets the taskRef field of the `Task`. Use only for tasks within pipelines:
* overrides `logicalID as the name of the `Task` in its individual yaml.
* @param task as string: name of the local task being referenced
* as IRemoteTaskResolver: resolver for a task in remote location
*/
public referencingTask(task: string | IRemoteTaskResolver): TaskBuilder {
if (typeof(task) == 'string') {
Expand All @@ -906,7 +908,8 @@ export class TaskBuilder {
}

/**
* TODO
* Gets the taskRef field of the `Task` for use within a pipeline.
* If not set, a locally-scoped task named with the `logicalID` is used.
*/
public get taskRef(): TaskRef | RemoteTaskRef {
return this._taskref || { name: this._id };
Expand Down Expand Up @@ -943,7 +946,8 @@ export class TaskBuilder {
});
});

// Note: buildTask called for this TaskBuilder object only if this.taskRef is a TaskRef
// Note: buildTask called for this TaskBuilder object only if this.taskRef is a TaskRef,
// not if it is a RemoteTaskRef
const taskName = ('name' in this.taskRef) ? this.taskRef.name : this.logicalID;

const props: TaskProps = {
Expand Down

0 comments on commit 0f960e0

Please sign in to comment.