0

We have a CI script which build a new beta package version out of the source code in SFDX format and when the package version is built, the new scratch org is created so that a previous release package version can be installed in it and upgraded with the new beta package version.

Since a scratch org is created from client production, the default user inherited email and some other properties from the production user from which the scratch is created.

When package is installed and upgraded, an email is sent to the production user email.

My clients don't like that and would prefer to replace the destination email.

I know we can use sfdx force:user:create command to create a user in a scratch org with a different email, but we can't get an sfdx auth url for such a user to use it instead of default user?

Alternatively, can we just change the email of the default user by CI?

2
  • Why can't you use sfdx auth url if the email is different ? Commented Feb 28, 2023 at 8:42
  • @FabienTaillon CI context is automated, so I need to make sure that I don't need to perform any manual action like following a link to setup user password, then run sfdx auth web login to get sfdx auth url token. But looks like, I have found a solution
    – Patlatus
    Commented Feb 28, 2023 at 8:49

1 Answer 1

0

To change an user email, a link should be clicked which is sent to the new email, so this is not possible to achieve in CI environment.

However, it is possible to use -a switch to define an alias for the user created, and it is possible to use the created user instead of default one by specifying -u switch with the alias of the user.

Also it is possible to use sfdx force:org:display --verbose -u command with -u switch to get the SFDX Auth URL to get the access to the scratch org user created in CI by downloading the artifact with this value in case if there is some error which should be troubleshooted and scratch org should not be deleted immediately.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .