Merge pull request #2824 from ministryofjustice/feature/CAS-1205-add-… #597
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}) |