generated from ministryofjustice/hmpps-template-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (43 loc) · 1.42 KB
/
generate-ui-types.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
43
44
45
name: Generate UI Types
on:
push:
branches:
- main
paths:
- 'src/main/resources/static/codegen/built-api-spec.yml'
jobs:
generate-ui:
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Trigger AP UI Type Generation Workflow
if: ${{ github.ref == 'refs/heads/main' }}
id: ap-trigger-ui-workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'hmpps-approved-premises-ui',
workflow_id: 'generate-types.yml',
ref: 'main'
})
- name: Trigger TA UI Type Generation Workflow
if: ${{ github.ref == 'refs/heads/main' }}
id: ta-trigger-ui-workflow
uses: actions/github-script@v6
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'hmpps-temporary-accommodation-ui',
workflow_id: 'generate-types.yml',
ref: 'main'
})