Skip to content

Commit

Permalink
trigger deployment webhook from reppo
Browse files Browse the repository at this point in the history
  • Loading branch information
Skitionek committed Apr 3, 2024
1 parent e993297 commit 254f224
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/call_webhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Trigger Target Workflow

on:
workflow_dispatch:
secrets:
WEBHOOK_TOKEN:
required: true
push:
branches:
- master

jobs:
trigger:
runs-on: ubuntu-latest

steps:
- name: Trigger Webhook
run: |
# Set the required variables
repo_owner="biosustain"
repo_name="lifelike-infrastructure"
load=$(
cat<<EOF
{
"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"

0 comments on commit 254f224

Please sign in to comment.