From 6ae38249c1cbe4901d464925f92982104cbc73df Mon Sep 17 00:00:00 2001 From: Jeremy Sfez Date: Mon, 2 Jan 2023 14:34:07 +0100 Subject: [PATCH] feat: add prNumber option --- packages/cli/src/index.ts | 2 ++ packages/core/src/upload.ts | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 83633518..a0317049 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -31,6 +31,7 @@ program 'One or more globs matching image file paths to ignore (ex: "**/*.png **/diff.jpg")' ) .option("--token ", "Repository token") + .option("--prNumber ", "Pull-request number") .option( "--build-name ", "Name of the build, in case you want to run multiple Argos builds in a single CI job" @@ -49,6 +50,7 @@ program buildName: options.buildName, files: options.files, ignore: options.ignore, + prNumber: options.prNumber, parallel: options.parallel ? { nonce: options.parallelNonce, total: options.parallelTotal } : false, diff --git a/packages/core/src/upload.ts b/packages/core/src/upload.ts index f8e65440..f105343a 100644 --- a/packages/core/src/upload.ts +++ b/packages/core/src/upload.ts @@ -23,6 +23,8 @@ export interface UploadParameters { branch?: string; /** Argos repository token */ token?: string; + /** Pull-request number */ + prNumber?: number; /** Name of the build used to trigger multiple Argos builds on one commit */ buildName?: string; /** Parallel test suite mode */ @@ -37,7 +39,8 @@ export interface UploadParameters { } const getConfigFromOptions = (options: UploadParameters) => { - const { apiBaseUrl, commit, branch, token, buildName, parallel } = options; + const { apiBaseUrl, commit, branch, token, buildName, parallel, prNumber } = + options; const config = createConfig(); config.load( @@ -46,6 +49,7 @@ const getConfigFromOptions = (options: UploadParameters) => { commit, branch, token, + prNumber, buildName, parallel: Boolean(parallel), parallelNonce: parallel ? parallel.nonce : null,