-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (48 loc) · 1.71 KB
/
dispatch.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
name: POC Trigger workflow
on:
workflow_dispatch:
inputs:
ref:
default: 'master'
description: ''
required: false
version:
description: 'Version plasma-icons package'
required: true
release:
types: [published]
jobs:
dispatch-manual:
if: ${{ github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- name: Dispatch custom event
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/PoligonSa/plasma-sandbox/dispatches \
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"${{github.event.inputs.version}}\", \"ref\": \"${{github.event.inputs.ref}}\"}}"
dispatch-published:
if: ${{ contains(github.event.release.name, 'plasmax-hope@') }}
runs-on: ubuntu-latest
steps:
- name: Get package version
run: |
echo "VERSION=$(echo "${{ github.event.release.tag_name }}" | cut -d '@' -f 2)" >> "$GITHUB_ENV"
- name: Dumb
env:
DATA: ${{ toJSON(github) }}
run: |
echo "$DATA"
- name: Dispatch custom event
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/PoligonSa/plasma-sandbox/dispatches \
-d "{\"event_type\":\"build-icons\",\"client_payload\":{\"version\":\"$VERSION\", \"ref\": \"dev\"}}"