on-backend-deploy #14
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 TypeScript types | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [on-backend-deploy] | |
jobs: | |
generate_types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install openapi-typescript | |
run: npm i -g openapi-typescript | |
- name: Run openapi-typescript | |
run: npx openapi-typescript https://gr.lnkshrt.xyz/openapi.json -o ./src/lib/api_schema.d.ts | |
- name: Commit file | |
run: | | |
git config --global user.name github-actions[bot] | |
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add src/lib/api_schema.d.ts | |
git commit -m "chore: generate API types" | |
git push |