diff --git a/login/Dockerfile b/login/Dockerfile index 90c6c18db..2a813075b 100644 --- a/login/Dockerfile +++ b/login/Dockerfile @@ -1,8 +1,11 @@ -FROM bycedric/ci-expo +FROM bycedric/ci-expo:2 -LABEL com.github.actions.name="Expo CLI Login" -LABEL com.github.actions.description="Use Expo CLI in your GitHub Actions workflow." -LABEL com.github.actions.icon="terminal" +LABEL com.github.actions.name="Login with Expo" +LABEL com.github.actions.description="Authenticate with Expo your GitHub Actions workflow." +LABEL com.github.actions.icon="log-in" LABEL com.github.actions.color="gray-dark" -ENTRYPOINT expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD \ No newline at end of file +COPY LICENSE.md README.md / +COPY entrypoint.sh /entrypoint-login.sh + +ENTRYPOINT ["/entrypoint-login.sh"] diff --git a/login/LICENSE.md b/login/LICENSE.md new file mode 100644 index 000000000..0dbf4c4e9 --- /dev/null +++ b/login/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2018 Cedric van Putten + +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/login/README.md b/login/README.md new file mode 100644 index 000000000..0b51c17d0 --- /dev/null +++ b/login/README.md @@ -0,0 +1,31 @@ +# Expo Login for GitHub Actions + +Authenticate the current workflow to publish new versions or create new builds. +It works relatively simple, you define the Expo credentials and this action will do the rest. + +## Usage + +First you need to define the [secrets listed below][#secrets] through [GitHub secrets](https://developer.github.com/actions/managing-workflows/storing-secrets/). +After that, you can add the action below in your workflow. + +```hcl +action "Login with Expo" { + uses = "bycedric/ci-expo/login@master" + secrets = ["EXPO_USERNAME", "EXPO_PASSWORD"] +} +``` + +### Secrets + +* `EXPO_USERNAME` - **Required**. The email address or username of the Expo account. +* `EXPO_PASSWORD` - **Required**. The password of the Expo account. + +## License + +The MIT License (MIT). Please see [License File](LICENSE.md) for more information. + +--- --- + +

+ with :heart: byCedric +

diff --git a/login/entrypoint.sh b/login/entrypoint.sh new file mode 100755 index 000000000..cc3431274 --- /dev/null +++ b/login/entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/sh -l + +set -e + +if [ -n "$EXPO_USERNAME" ] && [ -n "$EXPO_PASSWORD" ]; then + expo login --username $EXPO_USERNAME --password $EXPO_PASSWORD +else + echo "Please define both EXPO_USERNAME and EXPO_PASSWORD." + exit 1 +fi