Skip to content

Commit

Permalink
feat: add prNumber option
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfez committed Jan 2, 2023
1 parent 4b1aad8 commit 6ae3824
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ program
'One or more globs matching image file paths to ignore (ex: "**/*.png **/diff.jpg")'
)
.option("--token <token>", "Repository token")
.option("--prNumber <number>", "Pull-request number")
.option(
"--build-name <string>",
"Name of the build, in case you want to run multiple Argos builds in a single CI job"
Expand All @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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(
Expand All @@ -46,6 +49,7 @@ const getConfigFromOptions = (options: UploadParameters) => {
commit,
branch,
token,
prNumber,
buildName,
parallel: Boolean(parallel),
parallelNonce: parallel ? parallel.nonce : null,
Expand Down

0 comments on commit 6ae3824

Please sign in to comment.