forked from getgrav/grav
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (42 loc) · 1.41 KB
/
trigger-skeletons.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
name: Trigger Skeletons Build
on:
workflow_dispatch:
inputs:
version:
description: 'Which Grav release to use'
required: true
default: 'latest'
admin:
description: 'Create also a package with Admin'
required: true
default: true
jobs:
build:
runs-on: ubuntu-latest
env:
WORKFLOW: "build-skeleton.yml"
AUTH: ":${{secrets.GLOBAL_TOKEN}}"
steps:
- uses: actions/checkout@v2
- name: Make it rain ☔️
run: |
SKELETONS=`curl -s "${{secrets.SKELETONS_JSON_LIST}}"`
echo "$SKELETONS" | jq -cr '.[]' | while read SKELETON; do
KEY=$(echo "$SKELETON" | jq -cr 'keys[0]')
VERSION=$(echo "$SKELETON" | jq -cr '.[]')
URL="https://api.github.com/repos/${KEY}/actions/workflows/${WORKFLOW}/dispatches"
curl -X POST \
-u "${AUTH}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
-sS \
${URL} \
--data '{ "ref": "develop",
"inputs": {
"tag": "'"$VERSION"'",
"version": "'"$INPUT_VERSION"'",
"admin": "'"$INPUT_ADMIN"'"
}
}' > /dev/null
echo "Dispatched Worfklow for ${KEY}@$VERSION"
done