fix: add license header #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |