feat: JobArtifacts.downloadArchive: Add support for search_recent_successful_pipelines (#3812)

Co-authored-by: Simon Heather <simon.heather@yulife.com>
This commit is contained in:
Simon Heather 2026-01-23 19:21:27 +00:00 committed by GitHub
parent 227d803aeb
commit ab47aa6548
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View File

@ -38,7 +38,13 @@ export class JobArtifacts<C extends boolean = false> extends BaseResource<C> {
}: (
| { jobId: number; artifactPath?: undefined; job?: undefined; ref?: undefined }
| { jobId: number; artifactPath: string; job?: undefined; ref?: undefined }
| { ref: string; job: string; jobId?: undefined; artifactPath?: undefined }
| {
ref: string;
job: string;
jobId?: undefined;
artifactPath?: undefined;
searchRecentSuccessfulPipelines?: boolean;
}
| { ref: string; job: string; artifactPath: string; jobId?: undefined }
) & { jobToken?: string } & Sudo &
ShowExpanded<E> = {} as any,

View File

@ -108,6 +108,23 @@ describe('JobArtifacts.downloadArchive', () => {
},
);
});
it('should request GET /projects/:id/jobs/artifacts/:ref/download?job=:name&search_recent_successful_pipelines=true when searchRecentSuccessfulPipelines is true', async () => {
await service.downloadArchive(1, {
job: 'job1',
ref: 'ref1',
searchRecentSuccessfulPipelines: true,
});
expect(RequestHelper.get()).toHaveBeenCalledWith(
service,
`projects/1/jobs/artifacts/ref1/download`,
{
job: 'job1',
searchRecentSuccessfulPipelines: true,
},
);
});
});
describe('JobArtifacts.keep', () => {