fix workflow concurency (#4) #12
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 Target Workflow | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
trigger: | |
name: Trigger Webhook | |
runs-on: ubuntu-latest | |
steps: | |
- name: Trigger Webhook | |
env: | |
repo_owner: "biosustain" | |
repo_name: "lifelike-infrastructure" | |
run: | | |
load=$( | |
cat<<EOF | jq | |
{ | |
"event_type": "Source code update", | |
"client_payload": { | |
"caller": "${{ github.workflow }}", | |
"repository": "${{ github.repository }}", | |
"run_id": "${{ github.run_id }}" | |
} | |
} | |
EOF | |
) | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.WEBHOOK_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \ | |
-d "$load" | |
link="[$repo_owner/$repo_name](https://github.com/$repo_owner/$repo_name/actions)" | |
echo "Triggered webhook on $link" | tee $GITHUB_STEP_SUMMARY |