Skip to content

Commit

Permalink
v1 Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vhsantos26 committed Jun 2, 2021
1 parent ed3229e commit e00c9d9
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:dubnium-alpine

WORKDIR /app
COPY . /app

RUN npm install -g appcenter-cli \
&& apk update \
&& apk add git

RUN chmod +x /app/entrypoint.sh

ENTRYPOINT ["/app/entrypoint.sh"]
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
# app-center-cli-action
# App Center CLI Action

Enable the user to run any App Center CLI command.

## :rocket: Usage

A workflow example to run the App Center CLI command doing a Code Push deployment:

```yaml
name: App Center CLI Example

on: pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: yarn install

- run: yarn run unit-tests

app_center_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: vhsantos26/app-center-cli-action@v1
with:
user_token: ${{ secrets.APP_CENTER_TOKEN }}
command: appcenter codepush release-react -a Example/app-ios -d Staging
```
## :gear: Inputs
| Name | Description | Default | Required |
| ---------- | ------------------------- | :-----: | :------: |
| user_token | The user App Center token | | True |
| command | The App Center command | | True |
## :thought_balloon: Support
If you find our work useful, but for some reason there is something missing, please raise a pull request to us review it!
18 changes: 18 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "App Center CLI Action"
description: "Action responsible to enable the user to run any App Center command"
inputs:
command:
description: "App Center Command"
required: true
user_token:
description: "User token"
required: true
branding:
icon: terminal
color: red
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.command }}
- ${{ inputs.user_token }}
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

if [[ -z ${INPUT_USER_TOKEN} ]]; then
echo "[ERROR] The user token must not be empty!"
exit 1
fi

${INPUT_COMMAND} --token "${INPUT_USER_TOKEN}"

0 comments on commit e00c9d9

Please sign in to comment.