From 17771f6ea9532712cc7e8704b720a4bd125f08e5 Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Thu, 1 Aug 2024 00:58:35 +0200 Subject: [PATCH] add workflow --- .github/workflows/generate-api-client.yml | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/generate-api-client.yml diff --git a/.github/workflows/generate-api-client.yml b/.github/workflows/generate-api-client.yml new file mode 100644 index 00000000..b9dce420 --- /dev/null +++ b/.github/workflows/generate-api-client.yml @@ -0,0 +1,39 @@ +name: Generate API Client + +on: + push: + paths: + - 'server/application-server/**' + pull_request: + paths: + - 'server/application-server/**' + workflow_dispatch: + +jobs: + generate-api-client: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + + - name: Install dependencies + run: npm install + + - name: Generate API client + run: npm run generate:api + + - name: Commit and push changes + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git diff-index --quiet HEAD || git commit -m "chore: update API client" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}