Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Add a compareCommit param when creating build #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const config = convict({
default: '',
env: 'ARGOS_COMMIT',
},
compareCommit: {
doc: 'Git commit to compare to',
format: String,
default: '',
env: 'ARGOS_COMPARE_COMMIT',
},
branch: {
doc: 'Git branch',
format: String,
Expand Down
6 changes: 6 additions & 0 deletions src/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async function upload(options) {
token: tokenOption,
branch: branchOption,
commit: commitOption,
compareCommit: compareCommitOption,
externalBuildId: externalBuildIdOption,
buildName: buildNameOption,
batchCount: batchCountOption,
Expand All @@ -31,6 +32,7 @@ async function upload(options) {
}
const branch = branchOption || config.get('branch') || environment.branch
const commit = commitOption || config.get('commit') || environment.commit
const compareCommit = compareCommitOption || config.get('compareCommit') || environment.compareCommit
const externalBuildId =
externalBuildIdOption ||
config.get('externalBuildId') ||
Expand Down Expand Up @@ -73,6 +75,9 @@ async function upload(options) {

displayInfo(`using \`${branch}\` as branch`)
displayInfo(`using \`${commit}\` as commit`)
if (compareCommit) {
displayInfo(`using \`${compareCommit}\` as a comparison`)
}

const screenshots = await readScreenshots({ cwd: directory, ignore })

Expand All @@ -91,6 +96,7 @@ async function upload(options) {
name,
branch,
commit,
compareCommit,
token,
externalBuildId,
batchCount,
Expand Down