forked from zingdevlimited/actions-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
49 lines (46 loc) · 1.73 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "Create Flex Plugin Version"
description: Create a Flex Plugin Version from a URL
inputs:
PLUGIN_NAME:
required: true
description: Plugin name
PLUGIN_VERSION:
required: true
description: Plugin version
ASSET_URL:
required: true
description: The full URL to the deployed bundle asset of the Flex Plugin
TWILIO_API_KEY:
required: true
description: Twilio API Key
TWILIO_API_SECRET:
required: true
description: Twilio API Secret
outputs:
PLUGIN_VERSION_SID:
description: The Sid of the created/existing Plugin Version.
value: ${{ steps.create.outputs.PLUGIN_VERSION_SID }}
runs:
using: composite
steps:
- name: Validate Inputs
shell: bash
run: |
fail=""
[[ -z "${{ inputs.PLUGIN_NAME }}" ]] && echo "::error::Missing PLUGIN_NAME in inputs" && fail=1
[[ -z "${{ inputs.PLUGIN_VERSION }}" ]] && echo "::error::Missing PLUGIN_VERSION in inputs" && fail=1
[[ -z "${{ inputs.ASSET_URL }}" ]] && echo "::error::Missing ASSET_URL in inputs" && fail=1
[[ -z "${{ inputs.TWILIO_API_KEY }}" ]] && echo "::error::Missing TWILIO_API_KEY in inputs" && fail=1
[[ -z "${{ inputs.TWILIO_API_SECRET }}" ]] && echo "::error::Missing TWILIO_API_SECRET in inputs" && fail=1
[[ -n "$fail" ]] && exit 1 || exit 0
- name: Create Plugin Version ${{ inputs.PLUGIN_NAME }}@${{ inputs.PLUGIN_VERSION }}
id: create
shell: bash
run: |
${{ github.action_path }}/create-plugin-version.sh \
"${{ inputs.PLUGIN_NAME }}" \
"${{ inputs.PLUGIN_VERSION }}" \
"${{ inputs.ASSET_URL }}"
env:
TWILIO_API_KEY: ${{ inputs.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ inputs.TWILIO_API_SECRET }}