-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 1.15 KB
/
target_workflow.yaml
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
33
name: Trigger Deployment Workflow
on:
workflow_dispatch:
inputs:
target_service:
description: "Input a service name (e.g., demo-app)"
required: true
target_version:
description: "Input a version (e.g., v1.0.0)"
required: true
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: Trigger Deployment Workflow in PHDI-Playground Repository
run: |
# Set the required variables
repo_owner="CDCgov"
repo_name="phdi-playground"
event_type="trigger-workflow"
service="${{ github.event.inputs.target_service }}"
version="${{ github.event.inputs.target_version }}"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEPLOYMENT_WORKFLOW }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$version\", \"unit\": false, \"integration\": true}}"