diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 8363351..a031704 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 f8e6544..f105343 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,