/
action.yml
46 lines (44 loc) · 1.21 KB
/
action.yml
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
---
# action.yml
name: 'Screenly'
description: 'GitHub Actions for Screenly.'
author: 'Screenly, Inc'
branding:
icon: 'code'
color: 'purple'
inputs:
screenly_api_token:
description: "Your Screenly API token."
required: true
cli_commands:
description: "Your Screenly CLI command(s)."
required: true
cli_version:
description: "Screenly CLI version."
default: "v0.2.7"
outputs:
cli_commands_response:
description: "The response from the Screenly CLI command(s)."
value: ${{ steps.run-cli.outputs.response }}
runs:
using: 'composite'
steps:
- name: Download CLI
id: download-cli
run: |
pushd /tmp
wget -q -O screenly-cli.tar.gz \
"https://github.com/Screenly/cli/releases/download/${{ inputs.cli_version }}/screenly-cli-x86_64-unknown-linux-gnu.tar.gz"
tar xfz screenly-cli.tar.gz
chmod +x screenly
popd
shell: bash
- name: Run CLI
id: run-cli
run: |
set -o pipefail
output=$(API_TOKEN=${{ inputs.screenly_api_token }} /tmp/screenly ${{ inputs.cli_commands }} | tr '\n' ' ')
exit_code=$?
echo "response=$output" >> "$GITHUB_OUTPUT"
exit $exit_code
shell: bash