-
-
Notifications
You must be signed in to change notification settings - Fork 2
32 lines (28 loc) · 1008 Bytes
/
ppr-trigger.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
name: Trigger Workflows
on:
workflow_dispatch:
push:
branches:
- master
jobs:
trigger-actions:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Matrix
id: parse-log
run: |
updates_matrix="$(git log -1 --pretty=%b | awk '/^Update/,0 { if ($0 ~ /^ /) { sub(/:$/, "", $1); print $1 } }' | jq -R -s -c 'split("\n") | map(select(. != ""))')"
echo "updated='${updates_matrix}'" >> $GITHUB_ENV
echo "${updates_matrix}"
- name: Trigger Workflows
if: env.updated != '[]'
run: |
for package in $(echo ${{ env.updated }} | jq -r '.[]'); do
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-d "{\"event_type\": \"${package}\"}" \
https://api.github.com/repos/${{ github.repository }}/dispatches
done