Skip to content

Merge pull request #2746 from ministryofjustice/chore/remove-any-valu… #583

Merge pull request #2746 from ministryofjustice/chore/remove-any-valu…

Merge pull request #2746 from ministryofjustice/chore/remove-any-valu… #583

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'
})