generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.33 KB
/
remote-cd-trigger-template.yml
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
34
35
36
37
38
39
40
41
42
name: Template - Remote trigger to CDCent
on:
workflow_call:
inputs:
WORKFLOW:
type: string
description: "Workflow yml file that should be triggered."
required: true
REF:
type: string
description: "Git tag or branch the workflow is running on."
required: false
default: 'main'
jobs:
invoke-cd-trigger:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout Gen GitHub App Access Token
uses: actions/checkout@v3
with:
repository: kave/github-app-token
- name: Generate Token
run: |
sudo gem install jwt
echo "${{ secrets.CDC_COE_BOTFREY_PEM_LATEST }}" > app-private-key.pem
chmod +x ./get-github-app-access-token.sh;
. ./get-github-app-access-token.sh;
echo "access_token=${TOKEN}" >> "$GITHUB_ENV"
- name: Manually Dispatch Remote CICD Trigger Event
uses: actions/github-script@v6
with:
github-token: ${{ env.access_token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'cdcent',
repo: 'data-exchange-pstatus-devops',
workflow_id: '${{ inputs.WORKFLOW }}',
ref: 'main'
})