Skip to content

fix: make errors exit 1 #17

fix: make errors exit 1

fix: make errors exit 1 #17

Workflow file for this run

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: |
needed=0
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
if [[ ${updates_matrix} == "[]" ]]; then
echo "needed=0" >> $GITHUB_ENV
exit 0
else
echo "needed=1" >> $GITHUB_ENV
echo "${updates_matrix}"
fi
- name: Trigger Workflows
if: env.needed == '1'
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