generated from snow-actions/composite-action-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
77 lines (77 loc) · 2.36 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: List GitHub-hosted runners
description: List active GitHub-hosted runners
branding:
icon: list
color: blue
outputs:
all:
description: All runners
value: ${{ steps.all.outputs.json }}
latest:
description: Latest runners
value: ${{ steps.latest.outputs.json }}
ubuntu:
description: Ubuntu runners
value: ${{ steps.ubuntu.outputs.json }}
windows:
description: Windows runners
value: ${{ steps.windows.outputs.json }}
macos:
description: macOS runners
value: ${{ steps.macos.outputs.json }}
runs:
using: composite
steps:
- name: Original list
id: list
run: |
json=$(curl -sS https://json.schemastore.org/github-workflow.json \
| jq -c '.definitions.normalJob.properties["runs-on"].oneOf | map(select(.type == "string")) | first | .enum | map(select(. != "self-hosted"))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
shell: bash
- name: All runners
id: all
run: |
json=$(echo ${list} | jq -c 'map(select(endswith("-latest") | not))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
env:
list: ${{ steps.list.outputs.json }}
shell: bash
- name: Latest runners
id: latest
run: |
json=$(echo ${list} | jq -c 'map(select(endswith("-latest")))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
env:
list: ${{ steps.list.outputs.json }}
shell: bash
- name: Ubuntu runners
id: ubuntu
run: |
json=$(echo ${list} | jq -c 'map(select(startswith("ubuntu-") and (endswith("-latest") | not)))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
env:
list: ${{ steps.list.outputs.json }}
shell: bash
- name: Windows runners
id: windows
run: |
json=$(echo ${list} | jq -c 'map(select(startswith("windows-") and (endswith("-latest") | not)))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
env:
list: ${{ steps.list.outputs.json }}
shell: bash
- name: macOS runners
id: macos
run: |
json=$(echo ${list} | jq -c 'map(select(startswith("macos-") and (endswith("-latest") | not)))')
echo "${json}"
echo "json=${json}" >> $GITHUB_OUTPUT
env:
list: ${{ steps.list.outputs.json }}
shell: bash