generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
34 lines (30 loc) · 1.13 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
author: AVM
name: e2e - getexamples
description: Gets example directories from `examples/` and outputs them to the next step
inputs:
github-token:
description: The GitHub token to use for the API calls
required: true
outputs:
examples:
description: The examples to test
value: ${{ steps.getexamples.outputs.examples }}
runs:
using: composite
steps:
- name: get examples
id: getexamples
run: |
# Get latest release from GitHub API and get download URL for the Linux x64 binary
URL=$(curl -sL -H "Authorization: Bearer ${{ inputs.github-token }}" https://api.github.com/repos/matt-FFFFFF/jsonls/releases/latest \
| jq -r '.assets[] | select( .name | test("linux_amd64")) | .browser_download_url')
# Download the binary and extract
curl -sL "$URL" | tar -xvz jsonls
# Ensure exec bit set
sudo chmod a+x jsonls
# Move binary to path
sudo mv jsonls /usr/local/bin/jsonls
# Get the examples
echo examples="$(jsonls -d)" >> "$GITHUB_OUTPUT"
working-directory: examples
shell: bash