Bump swagger, include method descriptions to docstrings #3
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: Client Code Generation | |
on: | |
push: | |
paths: | |
- 'swagger.json' | |
- 'nswag.json' | |
- '**.liquid' | |
env: | |
TS_CLIENT_CHANGED: false | |
jobs: | |
generate_client: | |
name: Generate Client Code | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Setup NSwag CLI | |
run: dotnet tool install --global Nswag.ConsoleCore | |
- name: Generate Clients | |
run: nswag run | |
- name: Detect Code Changes | |
id: changes | |
uses: jitterbit/get-changed-files@v1 | |
- name: Detect TS Client Code Change | |
run: | | |
if [[ ${{ steps.changes.outputs.modified }} == *"index.ts"* ]]; then | |
echo "TS_CLIENT_CHANGED=true" >> $GITHUB_ENV | |
else | |
echo "TS_CLIENT_CHANGED=false" >> $GITHUB_ENV | |
fi | |
- name: Navigate to TS Client | |
if: env.TS_CLIENT_CHANGED == true | |
run: cd ${{ github.workspace }}/${{ vars.TS_CLIENT_PATH }} | |
- name: Setup node | |
if: env.TS_CLIENT_CHANGED == true | |
uses: actions/setup-node@v3 | |
with: | |
node_version: "20" | |
- name: Bump TS Client Package Version | |
if: env.TS_CLIENT_CHANGED == true | |
run: npm version patch | |
- name: Navigate to Repository Root | |
run: cd ${{ github.workspace }} | |
- name: Commit Changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Automated client code generation |