Skip to content

Commit

Permalink
refactor: use better expo cli variables prefix
Browse files Browse the repository at this point in the history
The password is already being picked up in the Expo CLI itself, so it's better to keep the same structure.

https://github.com/expo/expo-cli/blob/master/packages/expo-cli/src/accounts.js#L93
  • Loading branch information
byCedric committed Apr 10, 2019
1 parent 3c76843 commit cd75584
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can also use [the base image](base) in other Docker-based environments.

Within this Expo CLI action, you have full access to the original [Expo CLI][link-expo-cli].
That means you are able to perform any command like login, publish and build.
Also, this action will authenticate automatically when both `EXPO_USERNAME` and `EXPO_PASSWORD` variables are defined.
Also, this action will authenticate automatically when both `EXPO_CLI_USERNAME` and `EXPO_CLI_PASSWORD` variables are defined.

> You don't necessarily need this action to use Expo.
> You can also add `expo-cli` as a dependency to your project and use the official [NPM action][link-actions-npm] for example.
Expand All @@ -26,12 +26,12 @@ This makes the Expo actions overall faster.
### Used secrets

To authenticate with your Expo account, use the variables listed below.
In the Expo action you can define `secrets = ["EXPO_USERNAME", "EXPO_PASSWORD"]` to have them available.
In the Expo action you can define `secrets = ["EXPO_CLI_USERNAME", "EXPO_CLI_PASSWORD"]` to have them available.

variable | description
--- | ---
`EXPO_USERNAME` | The email address or username of your Expo account.
`EXPO_PASSWORD` | The password of your Expo account.
variable | description
--- | ---
`EXPO_CLI_USERNAME` | The email address or username of your Expo account.
`EXPO_CLI_PASSWORD` | The password of your Expo account, [automatically picked up by the cli][link-expo-cli-password].

> Some Expo commands don't require authentication.
> Simply omit the `secrets = [...]` if you don't need it.
Expand Down Expand Up @@ -66,7 +66,7 @@ action "Publish" {
needs = "Install"
uses = "byCedric/[email protected]"
args = "publish"
secrets = ["EXPO_USERNAME", "EXPO_PASSWORD"]
secrets = ["EXPO_CLI_USERNAME", "EXPO_CLI_PASSWORD"]
}
```

Expand Down Expand Up @@ -103,7 +103,7 @@ action "Publish" {
needs = "Filter branch"
uses = "byCedric/[email protected]"
args = "publish"
secrets = ["EXPO_USERNAME", "EXPO_PASSWORD"]
secrets = ["EXPO_CLI_USERNAME", "EXPO_CLI_PASSWORD"]
}
```

Expand Down Expand Up @@ -153,3 +153,4 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
[link-actions-npm]: https://github.com/actions/npm
[link-expo]: https://expo.io
[link-expo-cli]: https://docs.expo.io/versions/latest/workflow/expo-cli
[link-expo-cli-password]: https://github.com/expo/expo-cli/blob/8ea616d8848a123270b97e226e33dcb3dde49653/packages/expo-cli/src/accounts.js#L94
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -e

if [ -n "$EXPO_USERNAME" ] && [ -n "$EXPO_PASSWORD" ]; then
expo login --username $EXPO_USERNAME --password $EXPO_PASSWORD
if [ -n "$EXPO_CLI_USERNAME" ] && [ -n "$EXPO_CLI_PASSWORD" ]; then
expo login --username $EXPO_CLI_USERNAME
else
echo 'Skipping Expo login, username and/or password not defined...'
fi
Expand Down

0 comments on commit cd75584

Please sign in to comment.