forked from zingdevlimited/actions-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
44 lines (41 loc) · 1.69 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
name: "Add READ_ONLY permission to Sync object"
description: Add the READ_ONLY permission identity to a sync object
inputs:
SYNC_SERVICE_SID:
required: true
description: The Twilio Sync Service SID
OBJECT_TYPE:
required: true
description: The type of Sync object to update (Documents/Lists/Maps)
OBJECT_SID:
required: true
description: The sid or unique name of the Sync object to update
TWILIO_API_KEY:
required: true
description: Twilio API Key
TWILIO_API_SECRET:
required: true
description: Twilio API Secret
runs:
using: composite
steps:
- name: Validate Inputs
shell: bash
run: |
fail=""
[[ -z "${{ inputs.SYNC_SERVICE_SID }}" ]] && echo "::error::Missing SYNC_SERVICE_SID in inputs" && fail=1
[[ -z "${{ inputs.OBJECT_TYPE }}" ]] && echo "::error::Missing OBJECT_TYPE in inputs" && fail=1
[[ -z "${{ inputs.OBJECT_SID }}" ]] && echo "::error::Missing OBJECT_SID 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: Update ${{ inputs.SYNC_SERVICE_SID }}/${{ inputs.OBJECT_TYPE }}/${{ inputs.OBJECT_SID }}/Permissions/READ_ONLY
shell: bash
run: |
${{ github.action_path }}/add-readonly-perm-sync.sh \
"${{ inputs.OBJECT_TYPE }}" \
"${{ inputs.SYNC_SERVICE_SID }}" \
"${{ inputs.OBJECT_SID }}"
env:
TWILIO_API_KEY: ${{ inputs.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ inputs.TWILIO_API_SECRET }}